Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.util.Scanner;
- public class Journey_06 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- double price = 0;
- String type = "";
- String destinations = "";
- switch (season) {
- case ("summer"):
- if (budget <= 100) {
- price = 0.3 * budget;
- destinations = "Bulgaria";
- type = "Camp";
- } else if (budget > 100 && budget <= 1000) {
- price = 0.4 * budget;
- destinations = "Balkans";
- type = "Camp";
- } else if (budget > 1000){
- price = 0.9 * budget;
- destinations = "Europe";
- type = "Hotel";
- }
- break;
- case "winter":
- if (budget <= 100) {
- price = 0.7 * budget;
- destinations = "Bulgaria";
- type = "Hotel";
- } else if (budget > 100 && budget <= 1000) {
- price = 0.8 * budget;
- destinations = "Balkans";
- type = "Hotel";
- } else if (budget > 1000){
- price = 0.9 * budget;
- destinations = "Europe";
- type = "Hotel";
- }
- break;
- } System.out.printf("Somewhere in %s%n", destinations);
- System.out.printf("%s - %.2f", type, price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement