Advertisement
desislava_topuzakova

Untitled

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