Grade book

Gradebook

Processing a CSV download.

The results of three unit assessments for a course can be downloaded from an examining body website in CSV format. The data in `grade book.txt` is formatted as: forename, surname, unit 1 result, unit 2 result, unit 3 result. This program reads the data and outputs the results from a chosen unit.

Raghu,Aleksandra,78,63,0

Michelle,Chase,34,56,0

Max,Clayton,89,88,0

Selene,Dipti,79,82,0

Damon,Smith,56,63,0

Helen,Sorina,90,90,0

Briana,Takehiko,76,87,0

Make


Write a program that asks the user which unit to output the results for. The program then outputs the name of each student and the result they achieved in that unit.

Use this boilerplate code as a starting point:

Success Criteria

Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.

Complete the subprogram called `read_grade_book` that:

  1. Takes one parameter that is the filename of the results file.
  2. Reads the data into the global grade_book list declared in the main program.

Complete the subprogram called `output_assignment` that:

  1. Asks the user which unit they want to output the results for.
  2. Outputs the results of one unit formatted as shown below.

Complete the `main program` so that:

  1. An empty list called `grade_book` is declared.
  2. The subprogram `read_grade_book` is called.
  3. The subprogram `output_assignment` is called.

Typical inputs and outputs from the program would be:

Which unit do you want to output the results for? :1

Raghu Aleksandra: 78

Michelle Chase: 34

Max Clayton: 89

Selene Dipti: 79

Damon Smith: 56

Helen Sorina: 90

Briana Takehiko: 76


Which unit do you want to output the results for? :2

Raghu Aleksandra: 63

Michelle Chase: 56

Max Clayton: 88

Selene Dipti: 82

Damon Smith: 63

Helen Sorina: 90

Briana Takehiko: 87


Which unit do you want to output the results for? :3

Raghu Aleksandra: 0

Michelle Chase: 0

Max Clayton: 0

Selene Dipti: 0

Damon Smith: 0

Helen Sorina: 0

Briana Takehiko: 0

Knowledge Organiser

Use these resources as a reference to help you meet the success criteria.

Programming guide:

Evaluate


Run the unit tests below to check that your program has met the success criteria.

Which unit do you want to output the results for? :1

Raghu Aleksandra: 78

Michelle Chase: 34

Max Clayton: 89

Selene Dipti: 79

Damon Smith: 56

Helen Sorina: 90

Briana Takehiko: 76

Which unit do you want to output the results for? :2

Raghu Aleksandra: 63

Michelle Chase: 56

Max Clayton: 88

Selene Dipti: 82

Damon Smith: 63

Helen Sorina: 90

Briana Takehiko: 87

Which unit do you want to output the results for? :3

Raghu Aleksandra: 0

Michelle Chase: 0

Max Clayton: 0

Selene Dipti: 0

Damon Smith: 0

Helen Sorina: 0

Briana Takehiko: 0

Check that you have:

  • Used comments within the code to describe the purpose of subprograms, conditions and iterations.
  • Used meaningful identifier names. That means the names of subprograms and variables indicate what they are for.