Advertisement
yovkovbpfps

Contidional Statement Godzilla vs KONG

Apr 22nd, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Godzilla {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double movieBudget = Double.parseDouble(scanner.nextLine());
  7. int statistCount = Integer.parseInt(scanner.nextLine());
  8. double dressPrice = Double.parseDouble(scanner.nextLine());
  9. double sum = 0;
  10. double decor = movieBudget * 0.1;
  11. double dressTotal = statistCount * dressPrice;
  12. if (statistCount > 150) {
  13. dressTotal = dressTotal - (dressTotal * 0.10);
  14. }
  15. sum = decor + dressTotal;
  16. double diff = Math.abs(movieBudget - sum);
  17. if (movieBudget >= sum) {
  18. System.out.println("Action!");
  19. System.out.printf("Wingard starts filming with %.2f leva left.",diff);
  20. }else {
  21. System.out.println("Not enough money!");
  22. System.out.printf("Wingard needs %.2f leva more.", diff);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement