Advertisement
jwrbg

asd

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