Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class GodzilavsKong {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budgetFilm = Double.parseDouble(scanner.nextLine());
- int countStatists = Integer.parseInt(scanner.nextLine());
- double priceClothing = Double.parseDouble(scanner.nextLine());
- double priceAllClothing = priceClothing * countStatists;
- double priceDecor = 0.1 * budgetFilm;
- if (countStatists < 150) {
- double total = priceAllClothing + priceDecor;
- double rest = budgetFilm - total;
- if (rest > 0){
- System.out.println("Action!");
- System.out.printf("Wingard starts filming with %.2f leva left.", rest);
- } else{
- rest = Math.abs(rest);
- System.out.println("Not enough money!");
- System.out.printf("Wingard needs %.2f leva more.", rest);
- }
- } else{
- priceAllClothing = 0.9 * priceClothing * countStatists;
- double total = priceAllClothing + priceDecor;
- double rest = budgetFilm - total;
- if (rest > 0){
- System.out.println("Action!");
- System.out.printf("Wingard starts filming with %.2f leva left.", rest);
- } else{
- rest = Math.abs(rest);
- System.out.println("Not enough money!");
- System.out.printf("Wingard needs %.2f leva more.", rest);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement