Untitled

 avatar
unknown
plain_text
2 years ago
922 B
5
Indexable
import java.util.Scanner;
public class Assignment1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double racketPrice = Double.parseDouble(scanner.nextLine());
        int racketNumber = Integer.parseInt(scanner.nextLine());
        int sneakers = Integer.parseInt(scanner.nextLine());
        double sneakersPrice = racketPrice / 6.0;

        double racketsTotal = racketNumber * racketPrice;
        double sneakersTotal = sneakers * sneakersPrice;
        double equipmentTotal = racketsTotal + sneakersTotal + 0.2 * (racketsTotal + sneakersTotal);
        double djokerPays =  Math.floor(equipmentTotal / 8);
        double sponsorPays = Math.ceil(equipmentTotal * 7 / 8);

        System.out.printf("Price to be paid by Djokovic %d\n", (int)djokerPays);
        System.out.printf("Price to be paid by sponsors %d", (int)sponsorPays);
    }
}
Editor is loading...