fix(curriculum):updated test cases in gradebook-app (#61039)

This commit is contained in:
Abubakr Rizan
2025-06-25 01:15:38 +05:30
committed by GitHub
parent 7058bf5320
commit e7d83013e0
@@ -65,6 +65,18 @@ assert.strictEqual(getAverage([45, 87, 98, 100, 86, 94, 67, 88, 94, 95]), 85.4);
assert.strictEqual(getAverage([38, 99, 87, 100, 100, 100, 100, 100, 100, 100]), 92.4);
```
`getAverage([10, 20, 30, 40, 55, 65, 75, 83])` should return `47.25`.
```js
assert.strictEqual(getAverage([10, 20, 30, 40, 55, 65, 75, 83]), 47.25);
```
`getAverage([10, 20, 30, 40, 50, 60, 70, 97])` should return `47.125`.
```js
assert.strictEqual(getAverage([10, 20, 30, 40, 50, 60, 70, 97]), 47.125);
```
Your `getAverage` function should return the average score of the test scores.
```js
@@ -178,6 +190,18 @@ assert.strictEqual(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37), "C
assert.strictEqual(studentMsg([56, 23, 89, 42, 75, 11, 68, 34, 91, 19], 100), "Class average: 50.8. Your grade: A+. You passed the course.");
```
`studentMsg([12, 22, 32, 42, 52, 62, 72, 92], 85)` should return the following message: `"Class average: 48.25. Your grade: B. You passed the course."`.
```js
assert.strictEqual(studentMsg([12, 22, 32, 42, 52, 62, 72, 92], 85), "Class average: 48.25. Your grade: B. You passed the course.");
```
`studentMsg([15, 25, 35, 45, 55, 60, 70, 60], 75)` should return the following message: `"Class average: 45.625. Your grade: C. You passed the course."`.
```js
assert.strictEqual(studentMsg([15, 25, 35, 45, 55, 60, 70, 60], 75), "Class average: 45.625. Your grade: C. You passed the course.");
```
Your `studentMsg` function should return the correct message based on the student's score and the class average.
```js