Advertisement
Spocoman

Pool Day

Sep 9th, 2024
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 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.         int people = Integer.parseInt(scanner.nextLine());
  7.         double entrancePrice = Double.parseDouble(scanner.nextLine()),
  8.                 deskChairPrice = Double.parseDouble(scanner.nextLine()),
  9.                 umbrellaPrice = Double.parseDouble(scanner.nextLine()),
  10.                 total = entrancePrice * people
  11.                         + deskChairPrice * Math.ceil(0.75 * people)
  12.                         + umbrellaPrice * Math.ceil(0.5 * people);
  13.  
  14.         System.out.printf("%.2f lv.\n", total);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement