You are expected to produce a program that meets the following requirements.
A teacher is storing marks using a CSV file so that they can process them quickly. You can find the CSV file at http://www.bit.ly/42QrrAc.
They need to know which pupils as well as how many pupils have passed a test (60% or above) and who got the highest mark.
Some pseudocode for this is shown below:
1. INITIALISE ALL VARIABLES 2. READ MARKS IN FROM CSV FILE INTO PARALLEL ARRAYS 3. ITERATE THROUGH THE MARKS ARRAY 3.1 CHECK IF PUPIL RECEIVED 60% or above 3.1.1 INCREASE TOTAL BY ONE 3.2 IF MAXIMUM AGAINST IS LESS THAN THE PUPIL'S MARKS 3.2.1 SET MAXIMUM TO PUPIL'S MARKS 4. DISPLAY THE NUMBER OF PUPILS THAT PASSED 5. DISPLAY THE PUPIL WITH THE HIGHEST MARK SHOWING THE FIRST LETTER OF THEIR FORENAME WITH THEIR FULL SURNAME AND MARKS
They have hired you to develop this program.
The program - design
In this first step, you are expected to create a flow chart of this program. Once you have done this, show this to your teacher.
Set up the variables
Set up all initial variables. You may need to come back to this later.
Read the data from the CSV file
Using the CSV file provided, read the CSV file into parallel arrays so that you have three arrays, forenames, surnames and marks.
Do not perform step 3 of the pseudocode here, you should only be reading in the data here.
Go through the marks
Iterate through the results, checking if the pupil got more than 60%. If they did display their full forename and full surname on the screen as shown below:
Wilma Briony passed the test with 85%!
Do not display anything if the user did not pass the test.
Whilst iterating the marks, you can be checking to see if the user's marks are the top marks awarded using an algorithm to find a maximum.
Display the results
Display the results by printing them on the screen.
First, display how many pupils passed the test.
Second, display the first letter of the forename and the entire surname as well as their marks, of the pupil who got the highest mark.
Test and document your program
Test your program by debugging it, and changing the values in the CSV file to ensure it works on any CSV file given.
Ensure you have commented on your code nicely.