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