Untitled
unknown
plain_text
a year ago
1.0 kB
8
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 ", Math.abs(remainingSum));
System.out.print("leva more.");
} else {
System.out.printf("Action!\nWingard starts filming with %.2f ", remainingSum);
System.out.print("leva left.");
}
}
}Editor is loading...
Leave a Comment