Advertisement
martinvalchev

Cinema

Oct 31st, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Cinema {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         String type = scanner.nextLine();
  8.         int row = Integer.parseInt(scanner.nextLine());
  9.         int columb = Integer.parseInt(scanner.nextLine());
  10.         double price = -1;
  11.  
  12.         if (type.equals("Premiere")) {
  13.             price = 12;
  14.         } else if (type.equals("Normal")) {
  15.             price = 7.50;
  16.         } else if (type.equals("Discount")) {
  17.             price = 5;
  18.         }
  19.         System.out.printf("%.2f",(row * columb) * price);
  20.         System.out.print(" leva");
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement