Advertisement
AngelKejov

Godzilla vs. Kong

Apr 7th, 2021
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Exercise;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class GodzillaVSKong {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner sc = new Scanner(System.in);
  9.  
  10.         double filmBudget = Double.parseDouble(sc.nextLine());
  11.         int peopleCount = Integer.parseInt(sc.nextLine());
  12.         double priceForClothes = Double.parseDouble(sc.nextLine());
  13.  
  14.  
  15.         double decorsSum = (10 * filmBudget) / 100;
  16.         double clothesSum = peopleCount * priceForClothes;
  17.         if (peopleCount > 150) {
  18.             clothesSum = clothesSum - (0.10 * clothesSum);
  19.         }
  20.         double totalSumForFilm = decorsSum + clothesSum;
  21.  
  22.         if (totalSumForFilm >= filmBudget) {
  23.             double diff = Math.abs(filmBudget - totalSumForFilm);
  24.             System.out.printf("Not enough money!\n" +
  25.                     "Wingard needs %.2f leva " +
  26.                     "more.", diff);
  27.         } else {
  28.             double diff = Math.abs(filmBudget - totalSumForFilm);
  29.             System.out.printf("Action!\n" +
  30.                     "Wingard starts filming with " +
  31.                     "%.2f leva left.", diff);
  32.         }
  33.     }
  34. }
  35.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement