Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package examReal;
- import java.util.Scanner;
- public class OscarsWeekInCinema {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String name = scanner.nextLine();
- String type =scanner.nextLine();
- int boughtTickets= Integer.parseInt(scanner.nextLine());
- //double star =0.0;
- //double rhapsody =0.0;
- //double greebBook =0.0;
- //double favourite =0.0;
- double profit=0.0;
- if (name.equalsIgnoreCase("A Star Is Born")){
- if (type.equalsIgnoreCase("normal")){
- profit += boughtTickets* 7.5;
- }else if (type.equalsIgnoreCase("luxury")) {
- profit += boughtTickets* 10.5;
- }else if (type.equalsIgnoreCase("ultra luxury")){
- profit += boughtTickets* 13.5;
- }
- }else if (name.equalsIgnoreCase("Bohemian Rhapsody")){
- if (type.equalsIgnoreCase("normal")){
- profit += boughtTickets* 7.35;
- }else if (type.equalsIgnoreCase("luxury")) {
- profit += boughtTickets* 9.45;
- }else if (type.equalsIgnoreCase("ultra luxury")){
- profit += boughtTickets* 12.75;
- }
- }else if (name.equalsIgnoreCase("Green Book")){
- if (type.equalsIgnoreCase("normal")){
- profit+= boughtTickets* 8.15;
- }else if (type.equalsIgnoreCase("luxury")) {
- profit += boughtTickets* 10.25;
- }else if (type.equalsIgnoreCase("ultra luxury")){
- profit += boughtTickets* 13.25;
- }
- }else if (name.equalsIgnoreCase("The Favourite")){
- if (type.equalsIgnoreCase("normal")){
- profit+= boughtTickets* 8.75;
- }else if (type.equalsIgnoreCase("luxury")) {
- profit += boughtTickets* 11.55;
- }else if (type.equalsIgnoreCase("ultra luxury")){
- profit += boughtTickets* 13.95;
- }
- }
- System.out.printf("%s -> %.2f lv.",name,profit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement