AlexKondov

Java Cinema

May 20th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class Cinema {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.         String type = input.next();
  9.         double rows = input.nextDouble();
  10.         double columns = input.nextDouble();
  11.        
  12.         Double viewers = rows * columns;
  13.         if (type.equals("Premiere")) {
  14.             System.out.printf("%.2f leva", viewers * 12.00);
  15.         }
  16.         else if (type.equals("Normal")) {
  17.             System.out.printf("%.2f leva", viewers * 7.5);
  18.         }
  19.         else if (type.equals("Discount")) {
  20.             System.out.printf("%.2f leva", viewers * 5.00);
  21.         }
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment