Advertisement
Dilyana86

Untitled

Mar 21st, 2017
113
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 p03CarToGo {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6. double budget = Double.parseDouble(scan.nextLine());
  7. String season = scan.nextLine().toLowerCase();
  8.  
  9. if(budget <= 100){
  10. System.out.println("Economy class");
  11. if(season.equals("summer")){
  12. System.out.printf("Cabrio - %.2f%n",budget * 0.35);
  13. }else if(season.equals("winter")){
  14. System.out.printf("Jeep - %.2f%n",budget * 0.65);
  15. }
  16. }else if(budget > 100 && budget <= 500){
  17. System.out.println("Compact class");
  18. if(season.equals("summer")){
  19. System.out.printf("Cabrio - %.2f%n",budget * 0.45);
  20. }else if(season.equals("winter")){
  21. System.out.printf("Jeep - %.2f%n",budget * 0.80);
  22. }
  23. }else if(budget > 500){
  24. System.out.println("Luxury class");
  25. System.out.printf("Jeep - %.2f%n",budget * 0.90);
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement