Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Oskari {
- public static void main(String[] args) {
- Scanner scaner = new Scanner(System.in);
- String FilmName = scaner.nextLine();
- String Zala = scaner.nextLine();
- int Ticket = Integer.parseInt(scaner.nextLine());
- double price =0;
- switch (FilmName){
- case "A Star Is Born":
- if(Zala.equals("normal")){
- price = 7.50 * Ticket;
- }
- else if (Zala.equals("luxury")){
- price = 10.50 * Ticket;
- }
- else if (Zala.equals("ultra luxury")){
- price = 13.50 * Ticket;
- }
- else {
- System.out.println("Illegal hall name");
- }
- break;
- case "Bohemian Rhapsody":
- if(Zala.equals("normal")){
- price =7.35 * Ticket;
- }
- else if (Zala.equals("luxury")){
- price = 9.45 * Ticket;
- }
- else if (Zala.equals("ultra luxury")){
- price = 12.75 * Ticket;
- }
- else {
- System.out.println("Illegal hall name");
- }
- break;
- case "Green Book ":
- if(Zala.equals("normal")){
- price = 8.15 * Ticket;
- }
- else if (Zala.equals("luxury")){
- price = 10.25 * Ticket;
- }
- else if (Zala.equals("ultra luxury")){
- price = 13.25 * Ticket;
- }
- else {
- System.out.println("Illegal hall name");
- }
- break;
- case "The Favourite":
- if(Zala.equals("normal")){
- price = 8.75 * Ticket;
- }
- else if (Zala.equals("luxury")){
- price = 11.55 * Ticket;
- }
- else if (Zala.equals("ultra luxury")){
- price = 13.95 * Ticket;
- }
- else {
- System.out.println("Illegal hall name");
- }
- break;
- default:
- System.out.println("wrong film name ");
- }
- System.out.printf("%s -> %.2f lv");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement