Valantina

Movie_Day

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