Advertisement
marking2112

Journey

Oct 2nd, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Journey {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         double budget = Double.parseDouble(scanner.nextLine());
  8.         String season = scanner.nextLine();
  9.  
  10.         double price = 0;
  11.         String place = "";
  12.         String destination = "";
  13.         if (budget <= 100) {
  14.             destination = "Bulgaria";
  15.             if (season.equals("summer")) {
  16.                 price = budget * 30 / 100;
  17.                 place = "Camp";
  18.             } else if (season.equals("winter")) {
  19.                 price = budget * 70 / 100;
  20.                 place = "Hotel";
  21.             }
  22.         } else if (budget <= 1000) {
  23.             destination = "Balkans";
  24.             if (season.equals("summer")) {
  25.                 price = budget * 40 / 100;
  26.                 place = "Camp";
  27.             } else if (season.equals("winter")) {
  28.                 price = budget * 80 / 100;
  29.                 place = "Hotel";
  30.             }
  31.         } else if (budget > 1000) {
  32.             destination = "Europe";
  33.             price = budget * 90 / 100;
  34.             place = "Hotel";
  35.         }
  36.         System.out.printf("Somewhere in %s%n", destination);
  37.         System.out.printf("%s - %.2f", place, price);
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement