Advertisement
Deiancom

Godzilla vs. Kong

Jan 19th, 2020
789
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1. package ConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class GodzillaVsKong {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         double filmBudget = Double.parseDouble(scanner.nextLine());
  9.         int actorsCount = Integer.parseInt(scanner.nextLine());
  10.         double clothingPerActor = Double.parseDouble(scanner.nextLine());
  11.         double decorSum = filmBudget * 0.10;
  12.         double sumForClothing = actorsCount * clothingPerActor;
  13.         if (actorsCount > 150) {
  14.             sumForClothing = sumForClothing - (sumForClothing * 0.10);
  15.         }
  16.         double sumForFilm = decorSum + sumForClothing;
  17.         if (filmBudget >= sumForFilm) {
  18.             System.out.println("Action!");
  19.             System.out.printf("Wingard starts filming with %.2f leva left.",filmBudget - sumForFilm);
  20.         }else {
  21.             System.out.println("Not enough money!");
  22.             System.out.printf("Wingard needs %.2f leva more.",sumForFilm - filmBudget);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement