Advertisement
Spocoman

Movie Profit

Sep 8th, 2024
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         String movie = scanner.nextLine();
  7.         int days = Integer.parseInt(scanner.nextLine()),
  8.                 tickets = Integer.parseInt(scanner.nextLine());
  9.         double ticketPrice = Double.parseDouble(scanner.nextLine());
  10.         int percent = Integer.parseInt(scanner.nextLine());
  11.  
  12.         double price = days * tickets * ticketPrice * (100 - percent) / 100;
  13.  
  14.         System.out.printf("The profit from the movie %s is %.2f lv.", movie, price);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement