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 01:20
What is the full meaning of rfid in computer
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
Creating "smart interfaces" in all sectors of industry, government, and the public arena is one of the fastest growing hct areas. these interfaces model, interpret, and analyze such human characteristics as speech, gesture, and vision. the field of biometrics, in which humans authenticate themselves to machines, is an area of considerable interest to hct practitioners. fingerprint scans are one of the most frequently used biometric options, and this article, biometric student identification: practical solutions for accountability & security in schools, makes a case for the implementation of fingerprint scans in schools. critique the article, and answer the following questions: according to the author, what are the main benefits of adopting fingerprint scans in schools for student identification? according to the author, what are the main drawbacks of adopting fingerprint scans in schools for student identification? do you agree with the author's assessment of the pl
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
You know the right answer?
Modify the booklist program (from the lecture notes) by adding delet and insert operations into the...
Questions
question
Mathematics, 05.05.2020 02:19
Questions on the website: 13722360