Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Homework {
  3. public static void main(String[] args) {
  4. Scanner scanner = new Scanner(System.in);
  5. double filmBudget = Double.parseDouble(scanner.nextLine());
  6. int statistsNumber = Integer.parseInt(scanner.nextLine());
  7. double priceForOneStatistClothing = Double.parseDouble(scanner.nextLine());
  8. double decorForTheMovie = 0.10 * filmBudget;
  9. double totalPriceForStatistsClothing = statistsNumber * priceForOneStatistClothing;
  10. double moneyLeft = filmBudget - (decorForTheMovie + totalPriceForStatistsClothing);
  11. if (statistsNumber > 150){
  12. totalPriceForStatistsClothing = totalPriceForStatistsClothing * 0.90;
  13. } if ((decorForTheMovie + totalPriceForStatistsClothing) > filmBudget){
  14. double moneyNeed = ((decorForTheMovie + totalPriceForStatistsClothing) - filmBudget);
  15. System.out.println("Not enough money!");
  16. System.out.printf("Wingard needs %.2f leva more.", moneyNeed);
  17. } else if ((decorForTheMovie + totalPriceForStatistsClothing) <= filmBudget){
  18. System.out.println("Action!");
  19. System.out.printf("Wingard starts filming with %.2f leva left.", moneyLeft);
  20. }
  21.  
  22.  
  23. }
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement