Advertisement
Ivakis

Пътешествие

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