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