Advertisement
SIRAKOV4444

Untitled

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