Advertisement
Deiancom

Jurney

Jun 28th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.71 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Journey {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         double budget = Double.parseDouble(scanner.nextLine());
  9.         String season = scanner.nextLine();
  10.         double price = 0;
  11.         String destination = null;
  12.         String vacantionType = null;
  13.  
  14.         if (budget <= 100) {
  15.             destination = "Bulgaria";
  16.             if (season.equals("summer")) {
  17.                 price = budget * 0.30;
  18.                 vacantionType = "Camp";
  19.             }else if (season.equals("winter")) {
  20.                 price = budget * 0.70;
  21.                 vacantionType = "Hotel";
  22.             }
  23.         }else if (budget <= 1000) {
  24.             destination = "Balkans";
  25.             if (season.equals("summer")) {
  26.                 price = budget * 0.40;
  27.                 vacantionType = "Camp";
  28.             } else if (season.equals("winter")) {
  29.                 price = budget * 0.80;
  30.                 vacantionType = "Hotel";
  31.             }
  32.         }else {
  33.             destination = "Europe";
  34.             price = budget * 0.90;
  35.             vacantionType = "Hotel";
  36.             }
  37.         if (destination.equals("Bulgaria")) {
  38.             System.out.printf("Somewhere in %s %n",destination);
  39.             System.out.printf("%s - %.2f",vacantionType,price);
  40.         }else if (destination.equals("Balkans")) {
  41.             System.out.printf("Somewhere in %s %n",destination);
  42.             System.out.printf("%s - %.2f",vacantionType,price);
  43.         }else {
  44.             System.out.printf("Somewhere in %s %n",destination);
  45.             System.out.printf("%s - %.2f",vacantionType,price);
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement