Advertisement
Spocoman

Movie Day

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