Advertisement
Spocoman

Football Kit

Sep 6th, 2024
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. import java.io.PrintStream;
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.         double shirtsPrice = Double.parseDouble(scanner.nextLine()),
  8.                 neededSum = Double.parseDouble(scanner.nextLine()),
  9.                 shortsPrice = shirtsPrice * 0.75,
  10.                 socksPrice = shortsPrice / 5,
  11.                 sneakersPrice = (shirtsPrice + shortsPrice) * 2,
  12.                 totalSum = (shirtsPrice + shortsPrice + socksPrice + sneakersPrice) * 0.85;
  13.  
  14.         if (totalSum >= neededSum) {
  15.             System.out.printf("Yes, he will earn the world-cup replica ball!\nHis sum is %.2f lv.\n", totalSum);
  16.         } else {
  17.             System.out.printf("No, he will not earn the world-cup replica ball.\nHe needs %.2f lv. more.\n", neededSum - totalSum);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement