subject

Display the book with the longest title among the books whose bookType contain a specific substring. Ask the user for a substring. This function is used to demonstrate garbage collection. bookType With SpecificString(): • This function displays a book with the longest title among the books whose bookType contain a specific substring. • You should find the book as follows: 1. By traversing all books, you should find the books whose bookType include a specific substring. 2. After step 1, you should find the book whose title is the longest. You may use 'titleLength' and 'index' variable. 3. After step 2, copy the details of the book to 'bookWithLengthyTitle' object created using 'new' and display the book's details using 'bookWith LengthyTitle' object. 'new // // This function displays an book with the longest name among the books whose bookType contain a specific substring. // You should find the book as follows: 1/ 1. By traversing all books, you should find the books whose booktype include a specific substring. // NOTE: you need to get a substring from user after printing a prompt. (Check the output in the pdf) // HINT: You may refer to the document of string:: find. // 2. After step 1, you should find the book whose title is the longest. You may use 'titleLength' and 'index' variable. // 3. After step 2, copy the details of the book to 'bookWithLengthyTitle' object created using 11 and display the book's details using 'bookWithLengthyTitle' object. // NOTE: You necessarily have to use the 'bookWithLengthyTitle' object to store the book details in it and delete it after displaying. You should not display book details using 'bll' object. // 4. Finally delete the 'bookWithLengthyTitle' object. void () { string subString: // Ask the user for a character Book* bookWithLengthy Title = new Book; int titleLength = 0; int index = -1; // enter code here } 4. Finally delete the bookWith LengthyTitle 'object. CSE240 HW8 Please select an action: a: add a new book d: display book list s: sort the books in descending order based on ID (within a range) n: display the book with the longest title among the books whose bookType contain a specific substring q: quit Enter the substring of book's bookType: Non Title: A Promised Land ID: 2 Aisle: 102 Book Type: Nonfiction n #include using namespace std; class Book { private: string title; int ID, aisle; string bookType; public: Book(); // constructor void setTitle(string title_input); void setID(int id_input); void setAisle(int aisle_input); void setBookType(string bookType_input); void displayBook(); string getTitle(); int getID(); int getAisle(); string getBookType(); #include "book. h" #include #include #define MAX_BOOKS 5 using namespace std; // forward declaration of functions (already implmented) void executeAction(char); 1/ functions that need implementation: // in book. cpp: // Q1 Book constructor // 2 points // Q2 Book member functions // 18 points // in this file (hw0891.cpp) : 03 to 26 int addBook (string title_input, int id_input, int aisle_input, string bookType_input); // 10 points void displayBooks(); // 5 points void sort(); // 10 points void (); 1/ 5 points Book b[MAX_BOOKS); int current Count = 0; // array of objects // number of books in the list int main() { char choice = 'i'; // initialized to a dummy value do { cout << "\nCSE240 HW8\n"; cout << "Please select an action:\n"; cout << "\t a: add a new book\n"; cout << "\t d: display book list\n"; cout << "\t s: sort the books in descending order based on ID (within a range)\n"; cout << "\t n: display the book with the longest title among the books whose bookType contain a specific substring\n"; cout << "\t q: quit\n"; cin >> choice; sin. ignore(); // ignores the trailing In executeAction(choice); } while (choice != ''); return 0; }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 00:00
Afashion designer wants to increase awareness about her brand. which network can she use and why she can use the blank to blank her products online. answers for the first blank: internet, extranet, or intranet answers for the second blank: market, design, and export
Answers: 1
question
Computers and Technology, 24.06.2019 08:10
Where are american poets found in the dewey decimal system
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
What is a dashed line showing where a worksheet will be divided between pages when it prints? a freeze pane a split box a page break a print title
Answers: 1
question
Computers and Technology, 25.06.2019 06:00
Sam needs to create a spreadsheet for his coworkers. they will need to follow a crossed a long road of data. sam would like to make his spreadsheet easy to read. sam should
Answers: 1
You know the right answer?
Display the book with the longest title among the books whose bookType contain a specific substring....
Questions
question
Mathematics, 22.04.2020 23:54
question
Physics, 22.04.2020 23:54
question
Mathematics, 22.04.2020 23:54
Questions on the website: 13722360