Advertisement
Guest User

Joro

a guest
Jun 5th, 2014
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.  
  6. static void Main(string[] args)
  7. {
  8. Console.Title = "15.Joro, the Football Player";
  9. {
  10. Console.Write("Is the year leap (true) or not (false)? Please type \"t\" or \"f\": ");
  11. string leapYear = Console.ReadLine();
  12.  
  13. Console.Write("How many hollidays has Joro in the year?: ");
  14. float hollidays = float.Parse(Console.ReadLine());
  15.  
  16. Console.Write("How many hollidays in the year Joro spends in his hometown?: ");
  17. float homeTownWeekends = float.Parse(Console.ReadLine());
  18. float numberOfPlays = 0;
  19.  
  20. if (leapYear == "t")
  21. numberOfPlays = ((hollidays / 2) + (((52 - homeTownWeekends) * 2) / 3) + homeTownWeekends + 3);
  22.  
  23. else if (leapYear == "f")
  24. numberOfPlays = ((hollidays / 2) + (((52 - homeTownWeekends) * 2) / 3) + homeTownWeekends);
  25.  
  26. Console.WriteLine("Joro plays football {0} times in the year!", Math.Floor(numberOfPlays));
  27.  
  28. }
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement