Helena12

Journey

Nov 4th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.66 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class EP08Journey {
  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.         double tripBudget = 0;
  10.  
  11.         if (season.equalsIgnoreCase("summer")) {
  12.             if (budget <= 100) {
  13.                 System.out.println("Somewhere in Bulgaria");
  14.                 tripBudget = budget * 30 / 100;
  15.                 System.out.printf("Camp - %.2f", tripBudget);
  16.             } else if (budget <= 1000) {
  17.                 System.out.println("Somewhere in Balkans");
  18.                 tripBudget = budget * 40 / 100;
  19.                 System.out.printf("Camp - %.2f", tripBudget);
  20.             } else {
  21.                 System.out.println("Somewhere in Europe");
  22.                 tripBudget = budget * 90 / 100;
  23.                 System.out.printf("Hotel - %.2f", tripBudget);
  24.             }
  25.  
  26.         } else if (season.equalsIgnoreCase("winter")) {
  27.             if (budget <= 100) {
  28.                 System.out.println("Somewhere in Bulgaria");
  29.                 tripBudget = budget * 70 / 100;
  30.                 System.out.printf("Hotel - %.2f", tripBudget);
  31.             } else if (budget <= 1000) {
  32.                 System.out.println("Somewhere in Balkans");
  33.                 tripBudget = budget * 80 / 100;
  34.                 System.out.printf("Hotel - %.2f", tripBudget);
  35.             } else {
  36.                 System.out.println("Somewhere in Europe");
  37.                 tripBudget = budget * 90 / 100;
  38.                 System.out.printf("Hotel - %.2f", tripBudget);
  39.             }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment