Advertisement
Deiancom

Cinema

Jun 24th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Cinema {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         String projectionType = scanner.nextLine();
  9.         int line = Integer.parseInt(scanner.nextLine());
  10.         int column = Integer.parseInt(scanner.nextLine());
  11.         double price = 0;
  12.         double seats = line * column;
  13.         if (projectionType.equals("Premiere")) {
  14.             price = 12.00;
  15.         }else if (projectionType.equals("Normal")) {
  16.             price = 7.50;
  17.         }else if (projectionType.equals("Discount")) {
  18.             price = 5.00;
  19.         }
  20.         double profit = seats * price;
  21.         System.out.printf("%.2f",profit);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement