Advertisement
Kancho

Voyage

Feb 2nd, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Voyage {
  4. public static void main(String[] args) {
  5. Scanner keyboard = new Scanner(System.in);
  6. System.out.print("Enter sum: ");
  7. double budget = keyboard.nextDouble();
  8. System.out.print("Enter season - summer or winter: ");
  9. String season = keyboard.next();
  10.  
  11. if (budget <= 100) {
  12. if (season.equals("summer")) {
  13. System.out.printf("Somewhere in Bulgaria %nCamp - %.2f lv.", budget * 0.3);
  14. } else {
  15. System.out.printf("Somewhere in Bulgaria %nHotel - %.2f lv.", budget * 0.7);
  16. }
  17. } else if (100 < budget && budget <= 1000) {
  18. if (season.equals("sommer")) {
  19. System.out.printf("Somewhere in Balkans %nCamp - %.2f lv.", budget * 0.4);
  20. } else {
  21. System.out.printf("Somewhere in Balkans %nHotel - %.2f lv.", budget * 0.8);
  22. }
  23. } else {
  24. System.out.printf("Somewhere in Europa %nHotel - %.2f lv.", budget * 0.9);
  25. }
  26.  
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement