Krasimir_Slavov

Untitled

Nov 10th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Exam_Family_House
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int months = int.Parse(Console.ReadLine());
  14. double sumElectricity = 0;
  15.  
  16. for (int i = 0; i < months; i++)
  17. {
  18. sumElectricity += double.Parse(Console.ReadLine());
  19. }
  20. double sumOther = (sumElectricity + months * 35) * 1.20;
  21.  
  22. Console.WriteLine($"Electricity: {sumElectricity:F2} lv");
  23. Console.WriteLine($"Water: {months * 20:F2} lv");
  24. Console.WriteLine($"Internet: {months * 15:F2} lv");
  25. Console.WriteLine($"Other: {sumOther:F2} lv");
  26. Console.WriteLine($"Average: {(sumElectricity + sumOther + months * 35) / months:F2} lv");
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment