Advertisement
SIRAKOV4444

Untitled

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