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