aneliabogeva

Journey

Nov 10th, 2020 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1.     import java.util.Scanner;
  2.  
  3.     public class NewHome {
  4.         public static void main(String[] args) {
  5.             Scanner scanner = new Scanner(System.in);
  6.             Double budget = Double.parseDouble(scanner.nextLine());
  7.             String season = scanner.nextLine().toLowerCase();
  8.             Double totalPrice = 0.00;
  9.             String typeRoom = "";
  10.             String destination = "";
  11.  
  12.             if(budget <= 100){
  13.                 if("summer".equals(season)){
  14.                     totalPrice = budget * 0.30;
  15.                 }else if("winter".equals(season)){
  16.                     totalPrice = budget * 0.70;
  17.                 }
  18.                 destination = "Bulgaria";
  19.             }else if(budget <= 1000){
  20.                 if("summer".equals(season)){
  21.                     totalPrice = budget * 0.40;
  22.                 }else if("winter".equals(season)){
  23.                     totalPrice = budget * 0.80;
  24.                 }
  25.                 destination = "Balkans";
  26.             }else if(budget > 1000){
  27.                 totalPrice = budget * 0.90;
  28.                 destination = "Europe";
  29.             }else{}
  30.  
  31.             if("summer".equals(season) && !destination.equals("Europe")){
  32.                 typeRoom = "Camp";
  33.             }else{
  34.                 typeRoom = "Hotel";
  35.             }
  36.             System.out.printf("Somewhere in %s\n",destination);
  37.             System.out.printf("%s - %.2f",typeRoom, totalPrice);
  38.         }
  39.     }
  40.  
  41.  
Add Comment
Please, Sign In to add comment