Skip to content

Commit 42534de

Browse files
author
“A1-4U2T1NN”
committed
fix: converted scale from % to 4.0 l.53-71; 'included correct 'if' statement for 'n==0';
1 parent e5007e4 commit 42534de

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lesson_07/conditionals/src/lesson7.ts

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

51-
if(gpa >= 97){
51+
if(gpa >= 4.0){
5252
return "A+"
53-
}else if(gpa >= 93){
53+
}else if(gpa >= 4.0){
5454
return "A"
55-
}else if(gpa >= 90){
55+
}else if(gpa >= 3.7){
5656
return "A-"
57-
}else if(gpa >= 87){
57+
}else if(gpa >= 3.3){
5858
return "B+"
59-
}else if(gpa >= 83){
59+
}else if(gpa >= 3.0){
6060
return "B"
61-
}else if(gpa >= 80){
61+
}else if(gpa >= 2.7){
6262
return "B-"
63-
}else if(gpa >= 77){
63+
}else if(gpa >= 2.3){
6464
return "C+"
65-
}else if(gpa >= 73){
65+
}else if(gpa >= 2.0){
6666
return "C"
67-
}else if(gpa >= 70){
67+
}else if(gpa >= 1.7){
6868
return "C-";
69-
}else if(gpa >= 67){
69+
}else if(gpa >= 1.3){
7070
return "D+";
71-
}else if(gpa >= 65){
71+
}else if(gpa >= 1.0){
7272
return "D";
7373
}else{
7474
return "F"
@@ -117,7 +117,9 @@ export function addNumbers(values: number[]): number {
117117
export function getFirstNFibonacciNumbers(n: number): number[] {
118118

119119
const array = [n]
120-
120+
if (n == 0){
121+
return array;
122+
}
121123
for(let i = 2; i < n; i++){
122124
const cont = array[i - 1] + array[i - 2];
123125
array.push(cont)

0 commit comments

Comments
 (0)