Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class main4 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String typeRace = scanner.nextLine();
- String typeCoupon = scanner.nextLine();
- int couponCount = Integer.parseInt(scanner.nextLine());
- boolean freeImage = false;
- String trophy = scanner.nextLine();
- double priceCoupon = 0;
- if (typeRace.equalsIgnoreCase("Quarter final") && typeCoupon.equalsIgnoreCase("Standard")) {
- priceCoupon = 55.50 * couponCount;
- } else if (typeRace.equalsIgnoreCase("Quarter final") && typeCoupon.equalsIgnoreCase("Premium")) {
- priceCoupon = 105.20 * couponCount;
- } else if (typeRace.equalsIgnoreCase("Quarter final") && typeCoupon.equalsIgnoreCase("VIP")) {
- priceCoupon = 118.90 * couponCount;
- }
- if (typeRace.equalsIgnoreCase("Semi final") && typeCoupon.equalsIgnoreCase("Standard")) {
- priceCoupon = 75.88 * couponCount;
- } else if (typeRace.equalsIgnoreCase("Semi final") && typeCoupon.equalsIgnoreCase("Premium")) {
- priceCoupon = 125.22 * couponCount;
- } else if (typeRace.equalsIgnoreCase("Semi final") && typeCoupon.equalsIgnoreCase("VIP")) {
- priceCoupon = 300.40 * couponCount;
- }
- if (typeRace.equalsIgnoreCase("Final") && typeCoupon.equalsIgnoreCase("Standard")) {
- priceCoupon = 110.10 * couponCount;
- } else if (typeRace.equalsIgnoreCase("Final") && typeCoupon.equalsIgnoreCase("Premium")) {
- priceCoupon = 160.66 * couponCount;
- } else if (typeRace.equalsIgnoreCase("Final") && typeCoupon.equalsIgnoreCase("VIP")) {
- priceCoupon = 400 * couponCount;
- }
- if (priceCoupon > 4000) {
- priceCoupon = priceCoupon - 0.25 * priceCoupon;
- freeImage = true;
- }
- else if (priceCoupon > 2500) {
- priceCoupon = priceCoupon - 0.1 * priceCoupon;
- }
- if (trophy.equalsIgnoreCase("Y") && !freeImage){
- priceCoupon += 40 * couponCount;
- }
- System.out.printf("%.2f",priceCoupon);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement