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 stageOfTheChampionship = scanner.nextLine();
        String ticketType = scanner.nextLine();
        int brojKarata = Integer.parseInt(scanner.nextLine());
        String slikaTrofej = scanner.nextLine();
        double cenaZaKartu = 0;
        double cenaZaSlikuTrofej = 0;

        if (stageOfTheChampionship.equals("Quarterfinal")) {
            if (ticketType.equals("Standard")) {
                cenaZaKartu = 55.5;
            } else if (ticketType.equals("Premium")) {
                cenaZaKartu = 105.2;
            } else if (ticketType.equals("VIP")) {
                cenaZaKartu = 118.9;
            }

        } else if (stageOfTheChampionship.equals("Semi-final")) {
            if (ticketType.equals("Standard")) {
                cenaZaKartu = 75.88;
            } else if (ticketType.equals("Premium")) {
                cenaZaKartu = 125.22;
            } else if (ticketType.equals("VIP")) {
                cenaZaKartu = 300.4;

            }
        } else if (stageOfTheChampionship.equals("Final")) {
            if (ticketType.equals("Standard")) {
                cenaZaKartu = 110.1;
            } else if (ticketType.equals("Premium")) {
                cenaZaKartu = 160.66;
            } else if (ticketType.equals("VIP")) {
                cenaZaKartu = 400;
            }
        }
        double sumaZaKarte = cenaZaKartu * brojKarata;

        if (sumaZaKarte > 4000) {
            sumaZaKarte = 0.75 * sumaZaKarte;

        } else if (sumaZaKarte > 2500) {
            sumaZaKarte = 0.9 * sumaZaKarte;
            if (slikaTrofej.equals("Y")) {
                sumaZaKarte += 40 * brojKarata;
            }
        } else {
            if (slikaTrofej.equals("Y")) {
                sumaZaKarte += 40 * brojKarata;
            }
        }

        System.out.printf("%.2f", sumaZaKarte);

    }
}