Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class GodzillavsKong {
  3.     public static void main(String[] args) {
  4.  
  5.         Scanner sc = new Scanner(System.in);
  6.  
  7.         double budget = Double.parseDouble(sc.nextLine());
  8.         int actors = Integer.parseInt(sc.nextLine());
  9.         double priceForClothesFor1Actor = Double.parseDouble(sc.nextLine());
  10.  
  11.         double decor = budget * 0.1;
  12.         double discountForClothes = 0;
  13.         double priceForClothes = actors * priceForClothesFor1Actor;
  14.  
  15.         if (actors > 150) {
  16.             discountForClothes = actors * priceForClothesFor1Actor;
  17.             discountForClothes = discountForClothes * 0.1;
  18.  
  19.         }
  20.         double totalPriceForMovie = decor + discountForClothes;
  21.         if (totalPriceForMovie > budget) {
  22.             System.out.println("Not enough money!");
  23.             double moneyDiff = totalPriceForMovie - budget;
  24.             System.out.printf("Wingard needs %.2f leva more", moneyDiff);
  25.  
  26.         } else {
  27.             System.out.println("Action");
  28.             double moneyDiff = budget - totalPriceForMovie;
  29.             System.out.printf("Wingard starts fiming with %.2f leva left", moneyDiff);
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement