Advertisement
vlastomar

Untitled

Jul 31st, 2020
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class GodzillaVsKing {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6.  
  7. double budget = Double.parseDouble(scan.nextLine());
  8. int statist = Integer.parseInt(scan.nextLine());
  9. double priceClothesStatist = Double.parseDouble(scan.nextLine());
  10.  
  11. double expenses = statist * priceClothesStatist + budget * 0.10;
  12. if (statist > 150){
  13. expenses = statist * priceClothesStatist * 0.90 + budget * 0.10;
  14. }
  15.  
  16. if (expenses > budget){
  17. System.out.printf("Not enough money!%n");
  18. System.out.printf("Wingard needs %.2f leva more.", expenses - budget);
  19. }else {
  20. System.out.println("Action!");
  21. System.out.printf("Wingard starts filming with %.2f leva left.", budget - expenses);
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement