Advertisement
AJMitev

Volleyball

Feb 2nd, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2.  
  3. class Volleyball
  4. {
  5. static void Main(string[] args)
  6. {
  7. string typeOfYear = Console.ReadLine().ToLower();
  8. int holidays = int.Parse(Console.ReadLine());
  9. int weekendsInHometown = int.Parse(Console.ReadLine());
  10. int weekendsForVolleyball = 48;
  11.  
  12. double weekednsInSofia = (weekendsForVolleyball - weekendsInHometown)*0.750;
  13. double volleyballInHolidays = holidays * 0.666;
  14. double totalVolleyball = weekednsInSofia + weekendsInHometown + volleyballInHolidays;
  15. if (typeOfYear == "leap")
  16. {
  17. double leapYear = totalVolleyball * 0.150;
  18. totalVolleyball += leapYear;
  19. Console.WriteLine(Math.Truncate(totalVolleyball));
  20. }
  21. else if (typeOfYear =="normal")
  22. {
  23. Console.WriteLine(Math.Truncate(totalVolleyball));
  24. }
  25. else
  26. {
  27. Console.WriteLine("unknown type of year on line 1");
  28. }
  29.  
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement