public static void Main(){
Console.Write("enter the item's cost:");
int itemCost = Int32.Parse(Console.ReadLine());
int balance = CalculateSavings(itemCost);
Console.WriteLine("the item's cost was: "+itemCost+" and the money saved up in the end is: "+balance);
Console.Write("enter the item's cost:");
itemCost = Int32.Parse(Console.ReadLine());
balance = CalculateSavings(itemCost);
Console.WriteLine("the item's cost was: "+itemCost+" and the money saved up in the end is: "+balance);
public static int CalculateSavings(int itemCost){
Console.Write("enter the currant balance:");
int balance = Int32.Parse(Console.ReadLine());
bool enoughMoney = balance>=itemCost;
Console.Write("enter the amount of money gained:");
balance += Int32.Parse(Console.ReadLine());
Console.WriteLine("the current balance is: "+balance);
enoughMoney = balance>=itemCost;