Lessons 26–30 · About 60 min per lesson
Project: score report
Deliver a complete reporting program with tests from input to formatted output.
Lesson breakdown
- Lesson 26
Specify the batch size, pass mark and report fields.
- Lesson 27
Read the scores and implement maximum and count functions.
- Lesson 28
Add the mean and handle empty batches before division.
- Lesson 29
Check the exact output format against fixtures.
- Lesson 30
Submit source, compilation instructions and three tests.
Worked example
With pass mark 60, report the maximum, pass count and two-decimal mean of 59, 60 and 75.
How to solve it
The maximum is 75, 2 scores pass, and the total of 194 gives a mean of 64.67.
Assignment
Finish the score report and provide tests for an exact pass mark, an all-fail batch and an empty batch.
Check your result
The example reports 75, 2 and 64.67. An empty batch prints Empty.