Advertisement
MladenKarachanov

Godsilla.vsKong

Jul 15th, 2023
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package firststepsincoding.Godzillavs;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Godzilla.vsKong {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. double budjet = Double.parseDouble(scanner.nextLine());
  9. int numstatic = Integer.parseInt(scanner.nextLine());
  10. double priceonestatic = Double.parseDouble(scanner.nextLine());
  11. double decor = budjet / 10;
  12. double sumclothes = numstatic * priceonestatic;
  13. double result = decor + sumclothes;
  14. double totalsum = budjet - result;
  15. if (numstatic > 150) {
  16. sumclothes = sumclothes - sumclothes * 0.10;
  17.  
  18. }
  19. double finish = sumclothes + decor;
  20. double totalresult = budjet - finish;
  21.  
  22. if (sumclothes + decor <= budjet) {
  23. System.out.println("Action!");
  24. System.out.printf("Wingard starts filming with %.02f leva left.", totalresult);
  25. } else if (sumclothes + decor > budjet) {
  26.  
  27. System.out.println("Not enough money!");
  28. System.out.printf("Wingard needs %.02f leva more.", finish-budjet);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement