Advertisement
SIRAKOV4444

Untitled

Apr 4th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 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. if (budget <= 100) {
  18. destination = "Bulgaria";
  19. if ("summer".equals(season)) {
  20. house = "Camp";
  21. price = budget * 0.3;
  22. } else if ("winter".equals(season)) {
  23. house = "Hotel";
  24. price = budget * 0.7;
  25. }
  26. } else if (budget <= 1000) {
  27. destination = "Balkans";
  28. if ("summer".equals(season)) {
  29. house = "Camp";
  30. price = budget * 0.4;
  31. } else if ("winter".equals(season)) {
  32. house = "Hotel";
  33. price = budget * 0.8;
  34. }
  35. } else if (budget > 1000) {
  36. destination = "Europe";
  37. house = "Hotel";
  38. price = budget * 0.9;
  39. }
  40. System.out.printf("Somewhere in %s", destination).println();
  41. System.out.printf("%s - %.2f", house,price);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement