Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace AccountBalance
- {
- class Program
- {
- public static void Main()
- {
- string input = Console.ReadLine();
- double total = 0;
- while (input != "NoMoreMoney")
- {
- double cash = double.Parse(input);
- if (cash < 0)
- {
- Console.WriteLine("Invalid operation!");
- break;
- }
- else
- {
- Console.WriteLine($"Increase: { cash:f2}");
- total += cash;
- }
- input = Console.ReadLine();
- }
- Console.WriteLine($"Total: { total:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement