Advertisement
Valeri12580

Journey

Nov 3rd, 2018
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Jorney {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double budjet = Double.parseDouble(scanner.nextLine());
  7. String season = scanner.nextLine();
  8. double poharchenaSuma = budjet;
  9. String type = "";
  10. String destination = "";
  11. if (season.equals("summer")) {
  12. type = "Camp";
  13. if (budjet <= 100) {
  14. destination = "Bulgaria";
  15. poharchenaSuma *= 0.30;
  16. } else if (budjet <= 1000) {
  17. destination = "Balkans";
  18. poharchenaSuma *= 0.40;
  19. } else if (budjet > 1000) {
  20. type="Hotel";
  21. destination = "Europe";
  22. poharchenaSuma *= 0.90;
  23. }
  24. }else if (season.equals("winter")){
  25. type="Hotel";
  26. if (budjet<=100){
  27. destination="Bulgaria";
  28. poharchenaSuma*=0.70;
  29. }else if (budjet<=1000){
  30. destination="Balkans";
  31. poharchenaSuma*=0.80;
  32. }else{
  33. destination="Europe";
  34. poharchenaSuma*=0.90;
  35. }
  36. }
  37.  
  38. System.out.printf("Somewhere in %s%n",destination );
  39. System.out.printf("%s - %.2f",type,poharchenaSuma);
  40.  
  41.  
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement