Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E11Cinema {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String ticketType = scanner.nextLine().toLowerCase();
- int columsCount = Integer.parseInt(scanner.nextLine());
- int rowCount = Integer.parseInt(scanner.nextLine());
- double total = 0;
- switch (ticketType) {
- case "premiere":
- total = columsCount * rowCount * 12;
- break;
- }
- switch (ticketType) {
- case "normal":
- total = columsCount * rowCount * 7.50;
- break;
- }
- switch (ticketType) {
- case "discount":
- total = columsCount * rowCount * 5;
- break;
- }
- System.out.printf("%.2f leva", total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement