Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02.LunchBreak
- {
- class LunchBreak
- {
- static void Main(string[] args)
- {
- string nameTVshow = Console.ReadLine();
- double timeEpisode = double.Parse(Console.ReadLine());
- double breakTime = double.Parse(Console.ReadLine());
- double lunch = breakTime / 8;
- double rest = breakTime / 4;
- double allBreak = lunch + rest + timeEpisode;
- double difference = Math.Abs(breakTime - allBreak);
- if (breakTime >= allBreak)
- {
- Console.WriteLine($"You have enough time to watch " +
- $"{nameTVshow} and left with {Math.Ceiling(difference)} minutes free time.");
- }
- else
- {
- Console.WriteLine($"You don't have enough time to watch " +
- $"{nameTVshow}, you need {Math.Ceiling(difference)} more minutes.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment