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[]).

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.