Advertisement
Guest User

GodzillaVsKong

a guest
May 24th, 2019
92
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 U03GodzillaVsKong {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double budget = Double.parseDouble(scanner.nextLine());
  7. int statics = Integer.parseInt(scanner.nextLine());
  8. double clothing = Double.parseDouble(scanner.nextLine());
  9. double decors = 0.10 * budget;
  10. double clothingCost = clothing * statics;
  11. double totalCost = decors + clothingCost;
  12. if (statics > 150) {
  13. clothingCost -= 0.10 * clothingCost;
  14. }
  15. if (budget < totalCost) {
  16. double insuficient = totalCost - budget;
  17. System.out.println("Not enough money!");
  18. System.out.printf("Wingard needs %.2f leva more.", insuficient);
  19. } else {
  20. double excesive = budget - totalCost;
  21. System.out.println("Action!");
  22. System.out.printf("Wingard starts filming with %.2f leva left.", excesive);
  23. }
  24.  
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement