IvetValcheva

08. Lunch Break

Jan 17th, 2022
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Lunch_Break
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. //за сериал имаме 5/8 от обедната си почика
  10.  
  11. //1.Име на сериал – текст
  12. //2.Продължителност на епизод – цяло число в диапазона[10… 90]
  13. //3.Продължителност на почивката – цяло число в диапазона[10… 120]
  14.  
  15. string seriesName = Console.ReadLine();
  16. int seriesTime = int.Parse(Console.ReadLine());
  17. int lunchBreakTime = int.Parse(Console.ReadLine());
  18.  
  19. double timeForSeries = lunchBreakTime * 5.0 / 8;
  20.  
  21. //сериал=60 ,време за сериал =80
  22. //=> изваждаме от времето за сериал(80)-продължителността на сериала(60)
  23.  
  24. if (timeForSeries >= seriesTime)
  25. {
  26. Console.WriteLine
  27. ($"You have enough time to watch {seriesName} and left with {Math.Ceiling(timeForSeries-seriesTime)} minutes free time.");
  28. }
  29. else
  30. {
  31. Console.WriteLine
  32. ($"You don't have enough time to watch {seriesName}, you need {Math.Ceiling(seriesTime - timeForSeries)} more minutes.");
  33. }
  34. }
  35. }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment