Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Bills
- {
- class Program
- {
- static void Main(string[] args)
- {
- int months = int.Parse(Console.ReadLine());
- double electricityBills = 0;
- double waterBills = 0;
- double internetBills = 0;
- double othersBills = 0;
- double water = 20;
- double internet = 15;
- double otherBill = 0;
- for (int i = 1; i <= months; i++)
- {
- double electricityBill = double.Parse(Console.ReadLine());
- electricityBills += electricityBill;
- waterBills = months * water;
- internetBills = months * internet;
- othersBills = (electricityBill + water + internet) + ((electricityBill + water + internet) * 0.2);
- otherBill =+ othersBills;
- }
- double average = (electricityBills + waterBills + internetBills + othersBills) / months;
- Console.WriteLine($"Electricity: {electricityBills:f2} lv");
- Console.WriteLine($"Water: {waterBills:f2} lv");
- Console.WriteLine($"Internet: {internetBills:f2} lv");
- Console.WriteLine($"Other: {othersBills:f2} lv");
- Console.WriteLine($"Average: {average:f2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement