Skip to content

Commit 87887b1

Browse files
author
“A1-4U2T1NN”
committed
fix: added additional parameters in 'else-if' statements to correct errors;
1 parent ef2a1dd commit 87887b1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lesson_07/conditionals/src/lesson7.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@ export function compareStrings(a: string, b: string): number {
4848
*/
4949
export function convertGpaToLetterGrade(gpa: number): string {
5050

51-
if(gpa > 3.9){
51+
if(gpa > 4.0){
5252
return "A"
53-
}else if(gpa >= 3.3){
53+
}else if(gpa >= 3.7 && gpa < 4.0) {
5454
return "A-"
55-
}else if(gpa >= 3.0){
55+
}else if(gpa >= 3.3 && gpa < 3.7){
5656
return "B+"
57-
}else if(gpa >= 2.7){
57+
}else if(gpa >= 3 && gpa < 3.3){
5858
return "B"
59-
}else if(gpa >= 2.3){
59+
}else if(gpa >= 2.7 && gpa < 3){
6060
return "B-"
61-
}else if(gpa >= 2.0){
61+
}else if(gpa >= 2.3 && gpa < 3.7){
6262
return "C+"
63-
}else if(gpa >= 1.7){
63+
}else if(gpa >= 2 && gpa < 2.3){
6464
return "C"
65-
}else if(gpa >= 1.3){
65+
}else if(gpa >= 1.7 && gpa < 2){
6666
return "C-";
67-
}else if(gpa >= 1.0){
67+
}else if(gpa >= 1.3 && gpa < 1.7){
6868
return "D+";
69-
}else if(gpa >= 0.7){
69+
}else if(gpa >= 1.0 && gpa < 1.3){
7070
return "D";
7171
}else{
7272
return "F"

0 commit comments

Comments
 (0)