Advertisement
GalinaKG

Untitled

Feb 25th, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function carToGo (input) {
  2. let budget = Number(input[0]);
  3. let season = input[1];
  4. let classCar = 0;
  5. type = 0;
  6.  
  7. if (budget <= 100) {
  8. classCar = "Economy class";
  9. if (season === "Summer") {
  10. type = "Cabrio"
  11. } else {
  12. type = "Jeep"
  13. }
  14.  
  15. } else if (budget <= 500) {
  16. classCar = "Compact class";
  17. if (season === "Summer") {
  18. type = "Cabrio"
  19. } else {
  20. type = "Jeep"
  21. }
  22.  
  23.  
  24. } else {
  25. classCar = "Luxury class";
  26. type = "Jeep";
  27. }
  28. console.log(type)
  29.  
  30. }
  31. carToGo(["450", "Summer"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement