Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace claswork
- {
- using System;
- class ProgramForCalculatingFans
- {
- public static void Main()
- {
- int monthsNum = int.Parse(Console.ReadLine());
- const double waterBillPerMonth = 20;
- const double netBillPerMonth = 15;
- double electricityForAllMonths = 0;
- double drugiForALlMonths = 0;
- double totalForPeriod = 0;
- for (int i = 1; i <= monthsNum; i++)
- {
- double electricityBill = double.Parse(Console.ReadLine());
- electricityForAllMonths = electricityForAllMonths + electricityBill;
- double drugiZaMeseca = (waterBillPerMonth + netBillPerMonth + electricityBill) + ((waterBillPerMonth + netBillPerMonth + electricityBill) * 0.2);
- drugiForALlMonths += drugiZaMeseca;
- totalForPeriod += waterBillPerMonth + netBillPerMonth + electricityBill + drugiZaMeseca;
- }
- Console.WriteLine("Tok: {0:f2}", electricityForAllMonths);
- Console.WriteLine("Water: {0:f2}", waterBillPerMonth * monthsNum);
- Console.WriteLine("Net: {0:f2}", netBillPerMonth * monthsNum);
- Console.WriteLine("Drugi: {0:f2}", drugiForALlMonths);
- Console.WriteLine("Average: {0:f2}", totalForPeriod / monthsNum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement