Advertisement
Guest User

Untitled

a guest
Oct 8th, 2021
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class GodzillaKong_2 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double movieBudget = Double.parseDouble(scanner.nextLine());
  7.         int actors = Integer.parseInt(scanner.nextLine());
  8.         double clothes = Double.parseDouble(scanner.nextLine());
  9.  
  10.         double decorPrice = movieBudget / 10;
  11.         double clothPrice = actors * clothes;
  12.  
  13.         if (actors > 150){
  14.             double discount = clothPrice / 10;
  15.             clothPrice = clothPrice - discount;
  16.         }
  17.         double totalMoviePrice = decorPrice + clothPrice;
  18.         double moneyLeft = movieBudget - totalMoviePrice;
  19.  
  20.         if (totalMoviePrice <= movieBudget){ //here
  21.             System.out.print("Action!");
  22.             System.out.printf("%nWingard starts filming with %.2f leva left.", moneyLeft);
  23.         }
  24.         else if (movieBudget < totalMoviePrice){//Ето тук прави проблем  //here
  25.             System.out.print("Not enough money!");
  26.             System.out.printf("%nWingard needs %.2f leva more.", moneyLeft * -1); //here
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement