Untitled

 avatar
unknown
plain_text
a month ago
964 B
11
Indexable
import java.util.Scanner;

public class GvsK {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double budget = Double.parseDouble(sc.nextLine());
        int mutesCount = Integer.parseInt(sc.nextLine());
        double clothingPrice = Double.parseDouble(sc.nextLine());

        double decorPrice = budget * 0.1;
        double mutesClothingPrice = mutesCount * clothingPrice;
        if (mutesCount > 150) {
            mutesClothingPrice = mutesClothingPrice - mutesClothingPrice * 0.1;
        }

        double movieTotal = decorPrice + mutesClothingPrice;
        double remainingSum = budget - movieTotal;

        if (movieTotal > budget) {
            System.out.printf("Not enough money!\nWingard needs %.2f leva more.", Math.abs(remainingSum));
        } else {
            System.out.printf("Action!\nWingard starts filming with %.2f leva left.", remainingSum);
        }
    }
}
Leave a Comment