Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- Console.Title = "15.Joro, the Football Player";
- {
- Console.Write("Is the year leap (true) or not (false)? Please type \"t\" or \"f\": ");
- string leapYear = Console.ReadLine();
- Console.Write("How many hollidays has Joro in the year?: ");
- float hollidays = float.Parse(Console.ReadLine());
- Console.Write("How many hollidays in the year Joro spends in his hometown?: ");
- float homeTownWeekends = float.Parse(Console.ReadLine());
- float numberOfPlays = 0;
- if (leapYear == "t")
- numberOfPlays = ((hollidays / 2) + (((52 - homeTownWeekends) * 2) / 3) + homeTownWeekends + 3);
- else if (leapYear == "f")
- numberOfPlays = ((hollidays / 2) + (((52 - homeTownWeekends) * 2) / 3) + homeTownWeekends);
- Console.WriteLine("Joro plays football {0} times in the year!", Math.Floor(numberOfPlays));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement