Menu
support@authoritypapers.com
+1(805) 568 7317

q5 a 15 marks write and document a self referential structure definition called cont 5153857

Q5. a. (15 MARKS] Write and Document a self-referential structure definition called “contact” that stores the First Name (cha/* Create a second record linked to the first one, do this in a SINGLE STATEMENT without declaring any additional pointer varQ5. b. (2.5 MARKS] Develop the recursive function called PrintList as used in program 5a. Write the prototype and definitionQ5. c. (2.5 MARKS] Develop the recursive function called ClearList as used in program 3a. Write the prototype and definition

Q5. a. (15 MARKS] Write and Document a self-referential structure definition called “contact” that stores the First Name (char[41]), LastName (char[41]) and id (int) of a contact in the space provided. Then, complete the program as requested by the documentation located inside the program. (Do not use global variables). #include #include #include /* Write and document the self-referential structure definition for 'contact' below: */ [5 marks] 1 ———————————————– ——————————– void main() { /* Dynamically create a contact' record in a SINGLE STATEMENT (including declarations) */ [2] – – – – /* Initialize the values of the new record to: John Doe, id=10 */ [2 marks] – – – — /* Create a second record linked to the first one, do this in a SINGLE STATEMENT without declaring any additional pointer variables */ [2 marks] /* Initialize the values of the second record to: Will Smith, id=20 (without declaring new variables) */ [2 marks] —– —- 1 I —– ——– ——– – – – – – – – ——– ——– —– – – – ——– —– ———— /* Call the recursive function PrintList to print all the records to console (one statement) */[1] – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – /* Call the recursive function ClearList to erase all records from memory (one statement) */ [1] ——– Q5. b. (2.5 MARKS] Develop the recursive function called PrintList as used in program 5a. Write the prototype and definition (implementation) with complete documentation. PrintList displays all the records stored in the linked list to the screen. Use the format: LastName, FirstName ID to display each record. Q5. c. (2.5 MARKS] Develop the recursive function called ClearList as used in program 3a. Write the prototype and definition (implementation) with complete documentation. ClearList erases all the dynamic records from memory.

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon
"GET15"

Order Now