Advertisement
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 Bills
- {
- class Program
- {
- static void Main(string[] args)
- {
- int months = int.Parse(Console.ReadLine());
- double priceWater = 0;
- double priceElecticity = 0;
- double priceInternet = 0;
- double priceOther = 0;
- double priceOtherTotal = 0;
- double average = 0;
- priceWater = 20 * months;
- priceInternet = 15 * months;
- for (int i = 1; i <= months; i++)
- {
- double bill = double.Parse(Console.ReadLine());
- priceElecticity += bill;
- priceOther = (bill + 20 + 15) + (0.2 * (bill + 20 + 15));
- priceOtherTotal += priceOther;
- }
- average = (priceElecticity + priceInternet + priceOtherTotal + priceWater)/months;
- Console.WriteLine();
- Console.WriteLine($"Electricity: {priceElecticity:f2} lv");
- Console.WriteLine($"Water: {priceWater:f2} lv");
- Console.WriteLine($"Internet: {priceInternet:f2} lv");
- Console.WriteLine($"Other: {priceOtherTotal:f2} lv");
- Console.WriteLine($"Average: {average:f2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement