Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Input
- string seriesName = Console.ReadLine();
- int episodeLength = int.Parse(Console.ReadLine());
- int breakLength = int.Parse(Console.ReadLine());
- //Calculations
- double lunchTime = breakLength / 8.0;
- double freeTime = breakLength / 4.0;
- double neededTime = episodeLength + lunchTime + freeTime;
- //Output
- if (breakLength >= neededTime)
- {
- double remainingTime = breakLength - neededTime;
- Console.WriteLine($"You have enough time to watch {seriesName} and left with {Math.Ceiling(remainingTime)} minutes free time.");
- }
- else
- {
- double notEnoughTime = neededTime - breakLength;
- Console.WriteLine($"You don't have enough time to watch {seriesName}, you need {Math.Ceiling(notEnoughTime)} more minutes.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement