Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class U03GodzillaVsKong {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- int statics = Integer.parseInt(scanner.nextLine());
- double clothing = Double.parseDouble(scanner.nextLine());
- double decors = 0.10 * budget;
- double clothingCost = clothing * statics;
- double totalCost = decors + clothingCost;
- if (statics > 150) {
- clothingCost -= 0.10 * clothingCost;
- }
- if (budget < totalCost) {
- double insuficient = totalCost - budget;
- System.out.println("Not enough money!");
- System.out.printf("Wingard needs %.2f leva more.", insuficient);
- } else {
- double excesive = budget - totalCost;
- System.out.println("Action!");
- System.out.printf("Wingard starts filming with %.2f leva left.", excesive);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement