Advertisement
Spocoman

Godzilla vs. Kong

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