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