[Making the Grade]: Clarified Grading Intervals & Added Detail to Examples for Task 4 (#2784)

* Clarified the grading intervals and added detail to the examples for task 4.

* Reformatted via prettier.
This commit is contained in:
BethanyG
2021-11-16 00:31:14 -08:00
committed by GitHub
parent 62998dff62
commit 2c88507282
2 changed files with 29 additions and 7 deletions

View File

@@ -7,9 +7,9 @@ You decide to make things a little more interesting by putting together some fun
## 1. Rounding Scores
While you can give "partial credit" on exam questions, overall exam scores have to be `int`s.
So before you can do anything else with the class scores, you need to go through the grades and turn any `float` scores into `int`s. Lucky for you, Python has the built-in [`round()`][round] function you can use.
So before you can do anything else with the class scores, you need to go through the grades and turn any `float` scores into `int`s. Lucky for you, Python has the built-in [`round()`][round] function you can use.
A score of 75.45 or 75.49 will round to 75. A score of 43.50 or 43.59 will round to 44.
A score of 75.45 or 75.49 will round to 75. A score of 43.50 or 43.59 will round to 44.
There shouldn't be any scores that have more than two places after the decimal point.
Create the function `round_scores()` that takes a `list` of `student_scores`.
@@ -55,17 +55,33 @@ This function should return a `list` of all scores that are `>=` to `threshold`.
The teacher you're assisting likes to assign letter grades as well as numeric scores.
Since students rarely score 100 on an exam, the "letter grade" lower thresholds are calculated based on the highest score achieved, and increment evenly between the high score and the failing threshold of **<= 40**.
Create the function `letter_grades()` that takes the "highest" score on the exam as a parameter, and returns a `list` of lower score thresholds for each letter grade from "D" to "A".
Create the function `letter_grades()` that takes the "highest" score on the exam as a parameter, and returns a `list` of lower score thresholds for each "American style" grade interval: `["D", "C", "B", "A"]`.
```python
"""Where the highest score is 100, and failing is <= 40.
"F" <= 40
41 <= "D" <= 55
56 <= "C" <= 70
71 <= "B" <= 85
86 <= "A" <= 100
"""
>>> letter_grades(highest=100)
[41, 56, 71, 86]
"""Where the highest score is 88, and failing is <= 40.
"F" <= 40
41 <= "D" <= 52
53 <= "C" <= 64
65 <= "B" <= 76
77 <= "A" <= 88
"""
>>> letter_grades(highest=88)
[41, 53, 65, 77]
```
## 5. Matching Names to Scores
You have a list of exam scores in descending order, and another list of student names also sorted in descending order by their exam scores.
@@ -76,7 +92,6 @@ Match each student name on the student_names `list` with their score from the st
You can assume each argument `list` will be sorted from highest score(er) to lowest score(er).
The function should return a `list` of strings with the format `<rank>. <student name>: <student score>`.
```python
>>> student_scores = [100, 99, 90, 84, 66, 53, 47]
>>> student_names = ['Joci', 'Sara','Kora','Jan','John','Bern', 'Fred']
@@ -93,7 +108,7 @@ Create the function `perfect_score()` with parameter `student_info`.
`student_info` is a `list` of lists containing the name and score of each student: `[["Charles", 90], ["Tony", 80]]`.
The function should `return` _the first_ `[<name>, <score>]` pair of the student who scored 100 on the exam.
If no 100 scores are found in `student_info`, an empty list `[]` should be returned.
If no 100 scores are found in `student_info`, an empty list `[]` should be returned.
```python
>>> perfect_score(student_info=[["Charles", 90], ["Tony", 80], ["Alex", 100]])

View File

@@ -29,7 +29,14 @@ def above_threshold(student_scores, threshold):
def letter_grades(highest):
"""
:param highest: integer of highest exam score.
:return: list of integer score thresholds for each F-A letter grades.
:return: list of integer lower threshold scores for each D-A letter grade interval.
For example, where the highest score is 100, and failing is <= 40,
The result would be [41, 56, 71, 86]:
41 <= "D" <= 55
56 <= "C" <= 70
71 <= "B" <= 85
86 <= "A" <= 100
"""
pass