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 scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- String destination = "Europe";
- String accommodation = season.equals("summer") ? "Camp" : "Hotel";
- if (budget <= 100) {
- destination = "Bulgaria";
- budget *= season.equals("summer") ? 0.30 : 0.70;
- } else if (budget <= 1000) {
- destination = "Balkans";
- budget *= season.equals("summer") ? 0.40 : 0.80;
- } else {
- budget *= 0.90;
- accommodation = "Hotel";
- }
- System.out.printf("Somewhere in %s%n%s - %.2f", destination, accommodation, budget);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement