Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package examPreparation;
- import java.util.Scanner;
- public class MovieDestination {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String destination = scanner.nextLine();
- String season = scanner.nextLine();
- int daysCount = Integer.parseInt(scanner.nextLine());
- double pricePerShootingDay = 0.0;
- switch (destination) {
- case "Dubai" -> {
- if (season.equals("Winter")) {
- pricePerShootingDay = 45000;
- } else {
- pricePerShootingDay = 40000;
- }
- pricePerShootingDay = pricePerShootingDay * 0.70;
- }
- case "Sofia" -> {
- if (season.equals("Winter")) {
- pricePerShootingDay = 17000;
- } else {
- pricePerShootingDay = 12500;
- }
- pricePerShootingDay = pricePerShootingDay + (pricePerShootingDay * 0.25);
- // pricePerShootingDay = pricePerShootingDay * 1.25;
- }
- case "London" -> {
- if (season.equals("Winter")) {
- pricePerShootingDay = 24000;
- } else {
- pricePerShootingDay = 20250;
- }
- }
- }
- double finalPrice = pricePerShootingDay * daysCount;
- double diff = Math.abs(finalPrice - budget);
- if (budget >= finalPrice) {
- System.out.printf("The budget for the movie is enough! We have %.2f leva left!", diff);
- } else {
- System.out.printf("The director needs %.2f leva more!", diff);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement