Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The diagram shows the inheritance and the way the linked list should be formed.

ID: 3705181 • Letter: T

Question

The diagram shows the inheritance and the way the linked list should be formed. The list members are objects of class 'Book'. 'Noble' and 'Hayden' are child classes of 'Book'. list Book *book *book *book next next next null Book name name name inheritence noOfBooks noOfBooks noOfBooks libNumber libNumber libNumber Hayden Noble Book() getName( getNoOfBooks0 getLibraryNumber) displayBookinfo) Book) getName() getNoOfBooks() getLibraryNumber() displayBookinfo() Book() getName() getNoOfBooks() getLibraryNumber0) displayBookinfo) Hayden() displayBooklnfo() Noble() displayBooklnfo) 2 | Page CSE220 Programming for Computer Engineering Project 06 Your job is to follow the instructions given in comments in these files to complete the missing parts of the project so that the program executes properly. Book.h and Book.cpp completely define class 'Book'. No addition is required in these files.

Explanation / Answer

3a.

friend void changeNoOfBooks(Book *book, int noOfbooks);

//include this in Book.h (replace the comments.)

//this declares the changeNoOfBooks() function as a 'friend' of the Book class, meaning that it can access its members.

3b.

void changeNoOfBooks(Book *book, int noOfbooks)

{

cin >> *book;

cin >> *book->noOfbooks;

}

//include this in Main.cpp.

//this takes the inputs from the console and makes the changes to the noOfbooks value of the mentioned title.

3c.

changeNoOfBooks(*book, noOfbooks);

//include this in the (c='c') case.

//this will just call the function

[[P.S. As you didn't provide the Main.cpp file and the helper() function, the parameters might need changing of names]]

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote