yovkovbpfps

Simple Operatinons Football Kit

Apr 22nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ASD {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double tshirtPrice = Double.parseDouble(scanner.nextLine());
  7. double average = Double.parseDouble(scanner.nextLine());
  8.  
  9. double shortsPrice = tshirtPrice * 0.75;
  10. double socksPrice = shortsPrice * 0.20;
  11. double shoesPrice = (tshirtPrice + shortsPrice) * 2;
  12. double totalSum = tshirtPrice + shortsPrice + socksPrice + shoesPrice;
  13.  
  14. double discount = totalSum - (totalSum * 0.15);
  15. double moreMoney = Math.abs(discount - average);
  16.  
  17. if (discount >= average){
  18. System.out.printf("Yes, he will earn the world-cup replica ball!\n");
  19. System.out.printf("His sum is %.2f lv.",discount);
  20. } else {
  21. System.out.printf("No, he will not earn the world-cup replica ball.\n");
  22. System.out.printf("He needs %.2f lv. more.",moreMoney);
  23. }
  24.  
  25.  
  26.  
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment