Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- 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();
- double price = 0;
- String destination = null;
- String vacantionType = null;
- if (budget <= 100) {
- destination = "Bulgaria";
- if (season.equals("summer")) {
- price = budget * 0.30;
- vacantionType = "Camp";
- }else if (season.equals("winter")) {
- price = budget * 0.70;
- vacantionType = "Hotel";
- }
- }else if (budget <= 1000) {
- destination = "Balkans";
- if (season.equals("summer")) {
- price = budget * 0.40;
- vacantionType = "Camp";
- } else if (season.equals("winter")) {
- price = budget * 0.80;
- vacantionType = "Hotel";
- }
- }else {
- destination = "Europe";
- price = budget * 0.90;
- vacantionType = "Hotel";
- }
- if (destination.equals("Bulgaria")) {
- System.out.printf("Somewhere in %s %n",destination);
- System.out.printf("%s - %.2f",vacantionType,price);
- }else if (destination.equals("Balkans")) {
- System.out.printf("Somewhere in %s %n",destination);
- System.out.printf("%s - %.2f",vacantionType,price);
- }else {
- System.out.printf("Somewhere in %s %n",destination);
- System.out.printf("%s - %.2f",vacantionType,price);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement