BapBapuHa

journey

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