/// <summary> /// Adds the amount input by the user to the balance /// </summary> /// <param name="feed"></param> public void AddCustomerBalance(string feed) { try { decimal moneyFed = decimal.Parse(feed); if (moneyFed >= 0 && ((moneyFed % 1) == 0)) { CustomerBalance += moneyFed; Console.WriteLine("You have fed " + moneyFed.ToString("C2")); Console.WriteLine("Your balance is now " + CustomerBalance.ToString("C2")); Console.WriteLine(); } else { Console.WriteLine("Error: Please enter a whole number"); } } catch (Exception) { Console.WriteLine("Error: Please enter a whole number"); } }
public override string ToString() { return($"Status: {Status.ToString()} Balance Amount: {CustomerBalance.ToString()}"); }