Design and develop program to find the grade of the student using switch case statement
if grade is d, then distinction
If grade is A,then first division
If grade is B,then second division
If grade is C,then third division
If grade is F,then fail
Answers
Answered by
1
const gradeChecker = grade => {
switch(grade) {
case "D":
return "distinction"
case "A":
return "first division"
case "B":
return "second division"
case "C":
return "third divison"
case "F":
return "fail"
}
}
for (grade of ["A", "B", "C", "D", "F"]) {
console.log(gradeChecker(grade))
}
Similar questions