desislava_topuzakova

Untitled

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