Advertisement
tchenkov

L04u11_Cinema

Jan 23rd, 2017
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. package Uprajneniq;
  2.  
  3. import java.util.Scanner;
  4.  
  5. /**
  6.  * Created by todor on 23.01.2017 г..
  7.  */
  8. public class u11_Cinema {
  9.     public static void main(String[] args) {
  10.  
  11.         Scanner scan = new Scanner(System.in);
  12.  
  13.         String projectionType = scan.nextLine().toLowerCase();
  14.         int rows = Integer.parseInt(scan.nextLine());
  15.         int columns = Integer.parseInt(scan.nextLine());
  16.  
  17.         double ticketCount = rows * columns;
  18.         double total = 0;
  19.  
  20.         switch (projectionType) {
  21.             case "premiere":
  22.                 total = ticketCount * 12;
  23.                 break;
  24.             case "normal":
  25.                 total = ticketCount * 7.5;
  26.                 break;
  27.             case "discount":
  28.                 total = ticketCount * 5;
  29.         }
  30.  
  31.         System.out.printf("%.2f", total);
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement