Objective: to asses students understanding on the declaration of struct record type, application of the structured record type in an array, use of indexes in array and accessing of the data fields in array of structure records.
Study the given information and answer the questions that follow.
ABC school library stores the loan records as shown in Table 4.1. see image.
(a) Demonstrate the ability to use C++ to write code to construct a C++ record type, Loans to hold the fields, CustomerID, BookTitle, DateBorrowed and Returned. Write down the C++ declaration, myLoans to hold 5 such records.
(b) Develop the function, initialize() that initializes the values for array of structure record, myLoans declared in Part (a). The function prototype is void initialize(Loans[]). You may use (and hardcode) your own arbitrary values.
(c) Develop the function, booksOnLoan() that traverses the array of records and lists Titles of the books which are borrowed but not returned. The function prototype is void booksOnLoan(Loans[]).