Advertisement
Valik98

Journey

Sep 30th, 2019
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. package NestedConditionalStatements_3.exercises;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Journey {
  6.     public static void main(String[] args) {
  7.         Scanner console = new Scanner(System.in);
  8.  
  9.         double budget = Double.parseDouble(console.nextLine());
  10.         String season = console.nextLine();
  11.  
  12.         if (budget <= 100) {
  13.             if (season.equals("summer")) {
  14.                 System.out.printf("Somewhere in Bulgaria%nCamp - %.2f", budget * 0.3);
  15.             } else {
  16.                 System.out.printf("Somewhere in Bulgaria%nHotel - %.2f", budget * 0.7);
  17.             }
  18.         }
  19.         else if (budget <= 1000){
  20.             if (season.equals("summer")){
  21.                 System.out.printf("Somewhere in Balkans%nCamp - %.2f", budget * 0.4);
  22.             }else {
  23.                 System.out.printf("Somewhere in Balkans%nHotel - %.2f", budget * 0.8);
  24.             }
  25.         }
  26.         else if (budget > 1000){
  27.              if (season.equals("summer")){
  28.                  System.out.printf("Somewhere in Europe%nHotel - %.2f", budget * 0.9);
  29.             }else {
  30.                  System.out.printf("Somewhere in Europe%nHotel - %.2f", budget * 0.9);
  31.              }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement