Question: (a) Write a suitable set of type declarations for representing a list of football matches, where each match records the names of two competing teams
(a) Write a suitable set of type declarations for representing a list of football matches, where each match records the names of two competing teams and their integer scores. All matches are played in the same year, and this year should also be recorded. There are no limits on the number of matches, or on the length of team names.
(b) Based on your answer for part (a), show how to dynamically allocate the necessary memory for a set of 25 matches, where all the team names are at most 15 characters long. Initialisation is not required, except to allocate memory.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
