Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E02footballKit {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double tshirtPrice = Double.parseDouble(scanner.nextLine());
- double target = Double.parseDouble(scanner.nextLine());
- double shortsPrice = tshirtPrice * 0.75;
- double socksPrice = shortsPrice * 0.20;
- double shoesPrice = (shortsPrice + tshirtPrice) * 2;
- double TOTAL = (tshirtPrice + shortsPrice + socksPrice + shoesPrice)
- - ((tshirtPrice + shortsPrice + socksPrice + shoesPrice) * 0.15);
- double diff = Math.abs(target - TOTAL);
- if (TOTAL > target) {
- System.out.printf("Yes, he will earn the world-cup replica ball!%nHis sum is %.2f lv.", TOTAL);
- } else {
- System.out.printf("No, he will not earn the world-cup replica ball.%nHe needs %.2f lv. more.", diff);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment