Advertisement
Spocoman

05. Godzilla vs. Kong

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