Advertisement
desislava_topuzakova

03

Aug 20th, 2022
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. function solve(input){
  2. let type = input[0];
  3. let gender = input[1];
  4. let live = 0;
  5. switch(gender){
  6. case "m":
  7. if (type == "British Shorthair"){
  8. live = live = (13 * 12) / 6;
  9. console.log(`${live} cat months`)
  10. } else if (type == "Siamese"){
  11. live = (15 * 12) / 6;
  12. console.log(`${live} cat months`)
  13. } else if (type == "Persian"){
  14. live =(14 * 12) / 6;
  15. console.log(`${live} cat months`)
  16. } else if (type == "Ragdoll"){
  17. live = (16 * 12) / 6;
  18. console.log(`${live} cat months`)
  19. } else if (type == "American Shorthair"){
  20. live = (12 * 12) / 6;
  21. console.log(`${live} cat months`)
  22. } else if (type == "Siberian"){
  23. live = (11 * 12) / 6;
  24. console.log(`${live} cat months`)
  25. }else{
  26. console.log(`${type} is invalid cat!`)
  27. }
  28. break;
  29. case "f":
  30. if (type == "British Shorthair"){
  31. live = live = (14 * 12) / 6;
  32. console.log(`${live} cat months`)
  33. } else if (type == "Siamese"){
  34. live = (16 * 12) / 6;
  35. console.log(`${live} cat months`)
  36. } else if (type == "Persian"){
  37. live =(15 * 12) / 6;
  38. console.log(`${live} cat months`)
  39. } else if (type == "Ragdoll"){
  40. live = (17 * 12) / 6;
  41. console.log(`${live} cat months`)
  42. } else if (type == "American Shorthair"){
  43. live = (13 * 12) / 6;
  44. console.log(`${live} cat months`)
  45. } else if (type == "Siberian"){
  46. live = (12 * 12) / 6;
  47. console.log(`${live} cat months`)
  48. }else{
  49. console.log(`${type} is invalid cat!`)
  50.  
  51. }
  52.  
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement