Advertisement
lexxandras

Untitled

Apr 5th, 2020
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Journey {
  4. public static void main (String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6.  
  7. double budget = Double.parseDouble(scan.nextLine());
  8. String season = scan.nextLine();
  9. double price = 0;
  10. String destination = "";
  11. String type = "";
  12.  
  13. if (budget <= 100){
  14. destination = "Bulgaria";
  15. switch (season){
  16. case "summer":
  17. type = "Camp";
  18. price = budget * 0.30;
  19. break;
  20. case "winter":
  21. type = "Hotel";
  22. price = budget * 0.70;
  23. break;
  24. }
  25. } else if (budget <= 1000 ){
  26. destination = "Balkans";
  27. switch(season){
  28. case "summer":
  29. type = "Camp";
  30. price = budget * 0.40;
  31. break;
  32. case "winter":
  33. type = "Hotel";
  34. price = budget * 0.80;
  35. break;
  36. }
  37. } else if (budget > 1000){
  38. destination = "Europe";
  39. switch(season){
  40. case "summer":
  41. case "winter":
  42. type = "Hotel";
  43. price = budget * 0.90;
  44. }
  45. }
  46. System.out.printf("Somewhere in %s\n%s - %.2f", destination, type, price);
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement