Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 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. double budget = Double.parseDouble(scanner.nextLine());
  7. String season = scanner.nextLine();
  8. double cost = 0;
  9.  
  10. //• Първи ред – "Somewhere in [дестинация]“ измежду "Bulgaria", "Balkans" и "Europe"
  11. //• Втори ред – "{Вид почивка} – {Похарчена сума}"
  12.  
  13. if (budget <= 100 && season.equals("summer")) {
  14. cost = budget * 0.30;
  15. System.out.printf("Somewhere in Bulgaria %n");
  16. System.out.printf("Camp - %.2f", cost);
  17. } else if (budget < 100 && season.equals("winter")) {
  18. cost = budget * 0.70;
  19. System.out.printf("Somewhere in Bulgaria %n");
  20. System.out.printf("Hotel - %.2f", cost);
  21. }
  22. if (budget >100 && budget <= 1000 && season.equals("summer")) {
  23. cost = budget * 0.40;
  24. System.out.printf("Somewhere in Balkans %n");
  25. System.out.printf("Camp - %.2f", cost);
  26. } else if (budget > 100 && budget <= 1000 && season.equals("winter")) {
  27. cost = budget * 0.80;
  28. System.out.printf("Somewhere in Balkans %n");
  29. System.out.printf("Hotel - %.2f", cost);
  30. }
  31. if (budget > 1000){
  32. cost = budget * 0.90;
  33. System.out.printf("Somewhere in Europe %n");
  34. System.out.printf("Hotel - %.2f", cost);
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement