Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
687
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.09 KB | None | 0 0
  1. package examReal;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class OscarsWeekInCinema {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         String name = scanner.nextLine();
  9.         String type =scanner.nextLine();
  10.         int boughtTickets= Integer.parseInt(scanner.nextLine());
  11.         //double star =0.0;
  12.         //double rhapsody =0.0;
  13.         //double greebBook =0.0;
  14.         //double favourite =0.0;
  15.         double profit=0.0;
  16.  
  17.         if (name.equalsIgnoreCase("A Star Is Born")){
  18.             if (type.equalsIgnoreCase("normal")){
  19.                 profit += boughtTickets* 7.5;
  20.             }else if (type.equalsIgnoreCase("luxury")) {
  21.                 profit += boughtTickets* 10.5;
  22.             }else if (type.equalsIgnoreCase("ultra luxury")){
  23.                 profit += boughtTickets* 13.5;
  24.             }
  25.         }else if (name.equalsIgnoreCase("Bohemian Rhapsody")){
  26.             if (type.equalsIgnoreCase("normal")){
  27.                 profit += boughtTickets* 7.35;
  28.             }else if (type.equalsIgnoreCase("luxury")) {
  29.                 profit += boughtTickets* 9.45;
  30.             }else if (type.equalsIgnoreCase("ultra luxury")){
  31.                 profit += boughtTickets* 12.75;
  32.             }
  33.         }else if (name.equalsIgnoreCase("Green Book")){
  34.             if (type.equalsIgnoreCase("normal")){
  35.                  profit+= boughtTickets* 8.15;
  36.             }else if (type.equalsIgnoreCase("luxury")) {
  37.                 profit += boughtTickets* 10.25;
  38.             }else if (type.equalsIgnoreCase("ultra luxury")){
  39.                 profit += boughtTickets* 13.25;
  40.             }
  41.         }else if (name.equalsIgnoreCase("The Favourite")){
  42.             if (type.equalsIgnoreCase("normal")){
  43.                 profit+= boughtTickets* 8.75;
  44.             }else if (type.equalsIgnoreCase("luxury")) {
  45.                 profit += boughtTickets* 11.55;
  46.             }else if (type.equalsIgnoreCase("ultra luxury")){
  47.                 profit += boughtTickets* 13.95;
  48.             }
  49.         }
  50.         System.out.printf("%s -> %.2f lv.",name,profit);
  51.  
  52.  
  53.  
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement