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 row = Integer.parseInt(scanner.nextLine());
- int columb = Integer.parseInt(scanner.nextLine());
- double price = -1;
- if (type.equals("Premiere")) {
- price = 12;
- } else if (type.equals("Normal")) {
- price = 7.50;
- } else if (type.equals("Discount")) {
- price = 5;
- }
- System.out.printf("%.2f",(row * columb) * price);
- System.out.print(" leva");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement