Computers and Technology

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; }

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, dramaqueenactr2040
Two technicians are discussing the common u-joint. technician a says its input and output speeds should be equal. technician b says that it normally has two yokes. which technician is correct?
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, mem81
How can you repin an image on your pinterest pin board a. click on the "repin" button b. click on the "add pin" button c. click on the "upload a pin" button d. click on the "save pin" button.
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, summerjoiner
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
image
Computers and Technology, 24.06.2019 14:30, heathersloan274
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
Answers: 1
Do you know the correct answer?
Modify the booklist program (from the lecture notes) by adding delet and insert operations into the...

Questions in other subjects: