Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace BankAccount
- {
- class Program
- {
- static void Main(string[] args)
- {
- int transactionCount = int.Parse(Console.ReadLine());
- int counter = 1;
- double totalAmount = 0.0;
- while (counter <= transactionCount)
- {
- double transactionAmount = double.Parse(Console.ReadLine());
- if (transactionAmount < 0)
- {
- Console.WriteLine("Invalid operation!");
- break;
- }
- Console.WriteLine($"Increase: {transactionAmount:f2}");
- totalAmount += transactionAmount;
- counter++;
- }
- Console.WriteLine($"Total: {totalAmount:f2}");
- }
- }
- }
Add Comment
Please, Sign In to add comment