Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package _02_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 muteClothesPrice = Double.parseDouble(scanner.nextLine());
- double decor = budget * 0.10;
- if(mutesCount > 150) {
- muteClothesPrice = muteClothesPrice * 0.90;
- }
- double priceMutesClothing = muteClothesPrice * mutesCount;
- double totalPrice = decor + priceMutesClothing;
- double diff = Math.abs(totalPrice - budget);
- if(totalPrice > budget) {
- System.out.printf("Not enough money!%nWingard needs %.2f leva more.", diff);
- } else {
- System.out.printf("Action!%nWingard starts filming with %.2f leva left.", diff);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement