Helena12

Cinema

Nov 4th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class EP02Cinema {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         String projection = scanner.nextLine();
  8.         int row = Integer.parseInt(scanner.nextLine());
  9.         int column = Integer.parseInt(scanner.nextLine());
  10.  
  11.         int placesNumber = row * column;
  12.         double ticketsIncome = 0;
  13.  
  14.         switch (projection) {
  15.             case "Premiere":
  16.                 ticketsIncome = placesNumber * 12;
  17.                 System.out.printf("%.2f leva", ticketsIncome);
  18.                 break;
  19.             case "Normal":
  20.                 ticketsIncome = placesNumber * 7.50;
  21.                 System.out.printf("%.2f leva", ticketsIncome);
  22.                 break;
  23.             case "Discount":
  24.                 ticketsIncome = placesNumber * 5;
  25.                 System.out.printf("%.2f leva", ticketsIncome);
  26.         }
  27.  
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment