Valantina

MovieProfit

Jun 18th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P01_MovieProfit {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         String movieName = scan.nextLine();
  8.         int days = Integer.parseInt(scan.nextLine());
  9.         int ticketsCount = Integer.parseInt(scan.nextLine());
  10.         double ticketPrice = Double.parseDouble(scan.nextLine());
  11.         int percentMoneyForCinema = Integer.parseInt(scan.nextLine());
  12.  
  13.         double ticketsPricePerDay = ticketsCount * ticketPrice;
  14.  
  15.         double totalPrice = ticketsPricePerDay * days;
  16.         double moneyForCinema = totalPrice * percentMoneyForCinema / 100.0;
  17.         double studioIncome = totalPrice - moneyForCinema;
  18.  
  19.         System.out.println(String.format("The profit from the movie %s is %.2f lv.", movieName, studioIncome));
  20.     }
  21. }
Add Comment
Please, Sign In to add comment