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 issue4._19bills
- {
- class Program
- {
- static void Main(string[] args)
- {
- int months = int.Parse(Console.ReadLine());
- decimal totalElectro = 0;
- for(int i=0;i<months;i++)
- {
- decimal ElectroBill = decimal.Parse(Console.ReadLine());
- totalElectro += ElectroBill;
- }
- decimal waterBill = 20.00m * months;
- decimal netBill = 15.00m * months;
- decimal othersBill = (totalElectro + waterBill + netBill) + ((totalElectro + waterBill + netBill) * 0.20m);
- decimal totalBill = totalElectro + waterBill + netBill + othersBill;
- decimal averageBill = totalBill / months;
- Console.WriteLine($"Electricity: {totalElectro} lv.");
- Console.WriteLine("Water: {0:f2}", waterBill);
- Console.WriteLine("Internet: {0:f2}",netBill); ;
- Console.WriteLine("others: {0:f2}", othersBill);
- Console.WriteLine("Average: {0:f2}",averageBill);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment