Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Cinema {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String projectionType = scanner.nextLine();
- int line = Integer.parseInt(scanner.nextLine());
- int column = Integer.parseInt(scanner.nextLine());
- double price = 0;
- double seats = line * column;
- if (projectionType.equals("Premiere")) {
- price = 12.00;
- }else if (projectionType.equals("Normal")) {
- price = 7.50;
- }else if (projectionType.equals("Discount")) {
- price = 5.00;
- }
- double profit = seats * price;
- System.out.printf("%.2f",profit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement