aneliabogeva

Journey

Nov 10th, 2020
42
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×