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