Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class GodzillavsKong {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- double budget = Double.parseDouble(sc.nextLine());
- int actors = Integer.parseInt(sc.nextLine());
- double priceForClothesFor1Actor = Double.parseDouble(sc.nextLine());
- double decor = budget * 0.1;
- double discountForClothes = 0;
- double priceForClothes = actors * priceForClothesFor1Actor;
- if (actors > 150) {
- discountForClothes = actors * priceForClothesFor1Actor;
- discountForClothes = discountForClothes * 0.1;
- }
- double totalPriceForMovie = decor + discountForClothes;
- if (totalPriceForMovie > budget) {
- System.out.println("Not enough money!");
- double moneyDiff = totalPriceForMovie - budget;
- System.out.printf("Wingard needs %.2f leva more", moneyDiff);
- } else {
- System.out.println("Action");
- double moneyDiff = budget - totalPriceForMovie;
- System.out.printf("Wingard starts fiming with %.2f leva left", moneyDiff);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement