Advertisement
Spocoman

Tennis Equipment

Sep 10th, 2024
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double racketPrice = Double.parseDouble(scanner.nextLine());
  7.         int racketCount = Integer.parseInt(scanner.nextLine()),
  8.                 sneakersCount = Integer.parseInt(scanner.nextLine());
  9.         double racketsSum = racketPrice * racketCount,
  10.                 sneakersSum = racketPrice / 6 * sneakersCount,
  11.                 price = (racketsSum + sneakersSum) * 1.2;
  12.  
  13.         System.out.println("Price to be paid by Djokovic " + (int) (price / 8));
  14.         System.out.println("Price to be paid by sponsors " + (int) Math.ceil(price * 7 / 8));
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement