Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.1 kB
1
Indexable
Never
import java.util.Scanner;

public class Pasta {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String fazaPrvenstva = scanner.nextLine();
        String tipKarte = scanner.nextLine();
        int brojKarti = Integer.parseInt(scanner.nextLine());
        String fotografija = scanner.nextLine();


        double cenaKarte = 0;
        double cenaFotogravije = 40;

        switch (fazaPrvenstva) {
            case "Quarter final":


                if (tipKarte.equals("Standard")) {
                    cenaKarte = 55.50;
                } else if (tipKarte.equals("Premium")) {
                    cenaKarte = 105.20;
                } else if (tipKarte.equals("VIP")) {
                    cenaKarte = 118.90;

                }

                break;
            case "Semi final":
                if (tipKarte.equals("Standard")) {
                    cenaKarte = 75.88;
                } else if (tipKarte.equals("Premium")) {
                    cenaKarte = 125.22;
                } else if (tipKarte.equals("VIP")) {
                    cenaKarte = 300.40;

                }
                break;
            case "Final":
                if (tipKarte.equals("Standard")) {
                    cenaKarte = 110.10;
                } else if (tipKarte.equals("Premium")) {
                    cenaKarte = 160.66;
                } else if (tipKarte.equals("VIP")) {
                    cenaKarte = 400;

                }
                break;
            default:
                break;//break ide ispod svakog defaulta

        }

        double priceTotal = brojKarti * cenaKarte;


        if (priceTotal > 2500 && priceTotal <= 4000) {
            priceTotal *= 0.9;
        } else if (priceTotal >= 4000) {
            priceTotal = 0.75 * priceTotal;
        }

        if (fotografija == "Y" && priceTotal <= 4000) {
            priceTotal = priceTotal + (brojKarti * 40);
        }
        System.out.printf("%.2f", priceTotal);


    }
}