Advertisement
ventsislav83

Cinema

Jun 25th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.StringTokenizer;
  3.  
  4. public class test2 {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.  
  9.  
  10.         String type = scan.nextLine().toLowerCase();
  11.         int r = Integer.parseInt(scan.nextLine());
  12.         int c = Integer.parseInt(scan.nextLine());
  13.  
  14.         int full=r*c;
  15.         double income=1;
  16.  
  17.         switch (type){
  18.             case "premiere":
  19.                 income=full*12;
  20.                 break;
  21.             case  "normal":
  22.                 income=full*7.50;
  23.                 break;
  24.             case "Discount":
  25.                 income=full*5;
  26.                 break;
  27.  
  28.         }
  29.         System.out.printf("%.2f",income);
  30.  
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement