Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.PrintStream;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double shirtsPrice = Double.parseDouble(scanner.nextLine()),
- neededSum = Double.parseDouble(scanner.nextLine()),
- shortsPrice = shirtsPrice * 0.75,
- socksPrice = shortsPrice / 5,
- sneakersPrice = (shirtsPrice + shortsPrice) * 2,
- totalSum = (shirtsPrice + shortsPrice + socksPrice + sneakersPrice) * 0.85;
- if (totalSum >= neededSum) {
- System.out.printf("Yes, he will earn the world-cup replica ball!\nHis sum is %.2f lv.\n", totalSum);
- } else {
- System.out.printf("No, he will not earn the world-cup replica ball.\nHe needs %.2f lv. more.\n", neededSum - totalSum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement