Advertisement
MladenKarachanov

WorldSnookerChampionship

Nov 28th, 2023
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.96 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class WorldSnookerChampionship {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         String championshipStage = scanner.nextLine();
  7.         String typeOfTicket = scanner.nextLine();
  8.         int numTickets = Integer.parseInt(scanner.nextLine());
  9.         String photoWithTheTrophy = scanner.nextLine();
  10.         double price = 0;
  11.  
  12.         if (championshipStage.equals("Quarter final")) {
  13.             if (typeOfTicket.equals("Standard")) {
  14.                 price = 55.50 * numTickets;
  15.  
  16.             }
  17.  
  18.             if (typeOfTicket.equals("Premium")) {
  19.                 price = 105.20 * numTickets;
  20.  
  21.             }
  22.  
  23.             if (typeOfTicket.equals("VIP")) {
  24.                 price = 118.90 * numTickets;
  25.  
  26.             }
  27.         }
  28.          else if (championshipStage.equals("Semi final")) {
  29.             if (typeOfTicket.equals("Standard")) {
  30.                 price = 75.88 * numTickets;
  31.             }
  32.  
  33.             if (typeOfTicket.equals("Premium")) {
  34.                 price = 125.22 * numTickets;
  35.  
  36.             }
  37.             if (typeOfTicket.equals("VIP")) {
  38.                 price = 300.40 * numTickets;
  39.  
  40.             }
  41.         }
  42.         else if (championshipStage.equals("Final")) {
  43.             if (typeOfTicket.equals("Standard")) {
  44.                 price = 110.10 * numTickets;
  45.             }
  46.  
  47.             if (typeOfTicket.equals("Premium")) {
  48.                 price = 160.66 * numTickets;
  49.  
  50.             }
  51.             if (typeOfTicket.equals("VIP")) {
  52.                 price = 400 * numTickets;
  53.             }
  54.         }
  55.  
  56.  
  57.  
  58.         if (price > 4000) {
  59.             photoWithTheTrophy = "N";
  60.             price *= 0.75;
  61.  
  62.         } else if (price > 2500) {
  63.             price *= 0.90;
  64.         }
  65.         if (photoWithTheTrophy.equals("Y") && price < 4000){
  66.             price += 40.00 * numTickets;
  67.  
  68.         }
  69.         System.out.printf("%.2f\n", price);
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement