Advertisement
Guest User

Untitled

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