Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int movieTime = Integer.parseInt(scanner.nextLine()),
- scenes = Integer.parseInt(scanner.nextLine()),
- sceneTime = Integer.parseInt(scanner.nextLine());
- double totalTime = 0.15 * movieTime + scenes * sceneTime;
- if (totalTime >= movieTime) {
- System.out.println("Time is up! To complete the movie you need " + (int) Math.round(totalTime - movieTime) + " minutes.");
- } else {
- System.out.println("You managed to finish the movie on time! You have " + (int) Math.round(movieTime - totalTime) + " minutes left!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement