Advertisement
Gin10

Untitled

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