added example
This commit is contained in:
1 parent
06ef1abb6f
commit
f89714d647
1 file changed
+22
@@ -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));
|
||||||
|
|
||||||
Reference in new issue
Block a user