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