Advertisement
kuruku

Cinema

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