subject

Modify the booklist program (from the lecture notes) by adding delet and insert operations into the BookList class. The insert method should be based on a compareTo() method in the Book class that determines if one book title comes before another alphabetically. The insert method will maintain the BookList in alphabetical order. Exercise various insertion and deletion operations, using the code below for your main program: //lib. cpp #include "pch. h" #include using namespace std; #include "BookList. h" int main(int argc, char* argv[]) { // // Creates a BookList object, adds several books to the list, // then prints them. // char list[LIST_LEN]; BookList *books = new BookList(); books->insert (new Book("F Title") ); books->insert (new Book("D Title")); books->insert (new Book("G Title")); books->insert (new Book("A Title")); books->insert (new Book("E Title")); books->insert (new Book("H Title")); cout << "After inserts:\n"; cout << books->getBookList(list) << endl;; books->delet (new Book("A Title")); books->delet (new Book("H Title")); books->delet (new Book("G Title")); books->delet (new Book("E Title")); cout << "After deletes:\n"; cout << books->getBookList(list) << endl;; books->insert (new Book("A Title")); books->insert (new Book("E Title")); books->insert (new Book("H Title")); books->insert (new Book("G Title")); cout << "After 2nd inserts:\n"; cout << books->getBookList(list) << endl;; return 0; }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
question
Computers and Technology, 24.06.2019 21:50
The use of phrases, fragments, and punctuation can influence the mood of a passage; keeping this in mind, how would you describe the mood of the followingpassage? "fog on the essex marshes, fog on the kentish heights, fog creeping into the cabooses of collier-brigs; fog lying out on the yards, and hovering in the riggingof great ships; fog drooping on the gunwales of barges and small boats. fog in the eyes and throats of ancient greenwich pensioners, wheezing by thefiresides of their wards; fog in the stem and bowl of the afternoon pipe of the wrathful skipper; fog cruelly pinching the toes and fingers of his shivering little'prentice boy on deck." (5 points)
Answers: 2
You know the right answer?
Modify the booklist program (from the lecture notes) by adding delet and insert operations into the...
Questions
question
Mathematics, 25.11.2021 20:30
question
Health, 25.11.2021 20:30
Questions on the website: 13722360