silvana1303

movie day

Apr 30th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exampreparation
  4. {
  5.     class exam
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int time = int.Parse(Console.ReadLine());
  10.             int scenes = int.Parse(Console.ReadLine());
  11.             int duration = int.Parse(Console.ReadLine());
  12.  
  13.             double preparation = time * 0.15;
  14.             int scene = scenes * duration;
  15.             double needTime = preparation + scene;
  16.  
  17.             if (time >= needTime)
  18.             {
  19.                 Console.WriteLine($"You managed to finish the movie on time! You have {Math.Round(time-needTime)} minutes left!");
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine($"Time is up! To complete the movie you need {needTime-time} minutes.");
  24.             }
  25.         }
  26.     }
  27. }
Add Comment
Please, Sign In to add comment