Advertisement
dimipan80

C#Exams 1. Cinema (on Java Code)

Aug 22nd, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class _1_Cinema {
  4.  
  5.     public static void main(String[] args) {
  6.         // TODO Auto-generated method stub
  7.         Scanner scan = new Scanner(System.in);
  8.         String projectionType = scan.next();
  9.         int rows = scan.nextInt();
  10.         int columns = scan.nextInt();
  11.  
  12.         int numberOfPeople = rows * columns;
  13.         double incomes = numberOfPeople * 7.50;
  14.         if (projectionType.equals("Premiere")) {
  15.             incomes = numberOfPeople * 12.00;
  16.         } else if (projectionType.equals("Discount")) {
  17.             incomes = numberOfPeople * 5.00;
  18.         }
  19.  
  20.         System.out.printf("%.2f leva", incomes);
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement