Advertisement
Venciity

SoftUni Java] ExamPreparation 01.Cinema

May 20th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class _01_Cinema {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.         String movieType = input.next();
  9.         int rows = input.nextInt();
  10.         int cols = input.nextInt();
  11.  
  12.         double price = 0;
  13.        
  14.         switch (movieType) {
  15.         case "Premiere":
  16.             price = 12;
  17.             break;
  18.         case "Normal":
  19.             price = 7.5;
  20.             break;
  21.         case "Discount":
  22.             price = 5;
  23.             break;
  24.         }
  25.        
  26.         double result = rows * cols * price;
  27.         System.out.printf("%.2f leva", result);
  28.     }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement