Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package examPrep;
- import java.util.Scanner;
- public class P01PoolDay {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int people = Integer.parseInt(scanner.nextLine());
- double entranceFee = Double.parseDouble(scanner.nextLine());
- double chairPrice = Double.parseDouble(scanner.nextLine());
- double umbrellaPrice = Double.parseDouble(scanner.nextLine());
- double allFee = people * entranceFee;
- double allChairs = Math.ceil(people * 0.75) * chairPrice;
- double allUmbrellas = Math.ceil(people * 0.50) * umbrellaPrice;
- double totalSum = allFee + allChairs + allUmbrellas;
- System.out.printf("%.2f lv.", totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement