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 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 22.06.2019 20:30
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
question
Computers and Technology, 24.06.2019 00:00
Which tool could be used to display only rows containing presidents who served two terms
Answers: 3
question
Computers and Technology, 24.06.2019 02:20
Peter is thinking of a number which isless than 50. the number has 9 factors.when he adds 4 to the number, itbecomes a multiple of 5. what is thenumber he is thinking of ?
Answers: 1
You know the right answer?
Modify the booklist program (from the lecture notes) by adding delet and insert operations into the...
Questions