1/5
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Write the code to declare a struct to store a single Test:

Write a procedure to output/write a single Test to the terminal in the format shown in the example output on page 4. The procedure must accept a Test as a parameter using your struct from Q2.

Write a function to input/read a single Test from the user, as shown in the example output on page 4. This function must have no parameters, and return Test data using your struct from Q2.

In the space below write a function to find a Test in an array. This will be passed 2 parameters: ○) a prompt string ○) a dynamic array of Test values The function will return an integer. It will: ● Output the prompt (using write_line) ● Ask the user for the id of the Test to find (using read_integer). ● Search the array, and when a Test with a matching id is found, its index in the array will be returned. ● If the search ends without finding a matching Test, then the function returns -1.

In the space below write a function to calculate the average Score from an array of Tests (using your struct from Q2). It will be passed the array as a parameter, and return a double.
