Advertisement
gunes_94

kong-vs-godzilla

Jul 31st, 2020
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.54 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class GodzilavsKong {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double budgetFilm = Double.parseDouble(scanner.nextLine());
  7.         int countStatists = Integer.parseInt(scanner.nextLine());
  8.         double priceClothing = Double.parseDouble(scanner.nextLine());
  9.         double priceAllClothing = priceClothing * countStatists;
  10.  
  11.         double priceDecor = 0.1 * budgetFilm;
  12.         if (countStatists < 150) {
  13.             double total = priceAllClothing + priceDecor;
  14.             double rest = budgetFilm - total;
  15.             if (rest > 0){
  16.                 System.out.println("Action!");
  17.                 System.out.printf("Wingard starts filming with %.2f leva left.", rest);
  18.             } else{
  19.                 rest = Math.abs(rest);
  20.                 System.out.println("Not enough money!");
  21.                 System.out.printf("Wingard needs %.2f leva more.", rest);
  22.             }
  23.         } else{
  24.             priceAllClothing = 0.9 * priceClothing * countStatists;
  25.             double total = priceAllClothing + priceDecor;
  26.             double rest = budgetFilm - total;
  27.             if (rest > 0){
  28.                 System.out.println("Action!");
  29.                 System.out.printf("Wingard starts filming with %.2f leva left.", rest);
  30.             } else{
  31.                 rest = Math.abs(rest);
  32.                 System.out.println("Not enough money!");
  33.                 System.out.printf("Wingard needs %.2f leva more.", rest);
  34.             }
  35.         }
  36.     }
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement