Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Account_Balance__new_version_;
- class Program
- {
- static void Main(string[] args)
- {
- string command = Console.ReadLine();
- double sum = 0.0;
- while (command != "End!")
- {
- double currentDeposit = double.Parse(command);
- sum += currentDeposit;
- if(currentDeposit > 0)
- {
- Console.WriteLine($"Increase: {currentDeposit:f2}");
- }
- if(currentDeposit < 0)
- {
- Console.WriteLine($"Decrease: {Math.Abs(currentDeposit):f2}");
- break;
- }
- /*if (currentDeposit == 0)
- {
- break;
- }*/
- command = Console.ReadLine();
- }
- Console.WriteLine($"Balance: {sum:f2}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment