Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package S2_ConditionalStatements;
- import java.util.Scanner;
- public class GodzillaVsKong {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- int mutesCount = Integer.parseInt(scanner.nextLine());
- double muteClothingPrice = Double.parseDouble(scanner.nextLine());
- double totalPriceMutesClothing = mutesCount * muteClothingPrice;
- double decorPrice = budget * 0.10;
- if (mutesCount > 150) {
- //totalPriceMutesClothing = totalPriceMutesClothing - (totalPriceMutesClothing * 0.10);
- totalPriceMutesClothing = totalPriceMutesClothing * 0.90;
- }
- double finalPrice = decorPrice + totalPriceMutesClothing;
- double diff = Math.abs(finalPrice - budget);
- if (budget >= finalPrice) {
- System.out.printf("Action!%nWingard starts filming with %.2f leva left.", diff);
- } else {
- System.out.printf("Not enough money!%nWingard needs %.2f leva more.", diff);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement