added example

This commit is contained in:
didier amyot committed 2023-09-15 14:06:15 -04:00
1 parent 06ef1abb6f
commit f89714d647
1 file changed
+22
+22
View File
@@ -0,0 +1,22 @@
function plusOrMinus(noteRange: number): string{
if(noteRange < 3){
return "-"
}
if(noteRange > 7){
return "+";
}
return "";
}
function grade(note: number): string {
if(note > 90){
return "A" + plusOrMinus(note - 90);
}
if(note > 80){
return "B" + plusOrMinus(note - 80);
}
return "";
}
console.log(grade(81));