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