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, 21.06.2019 22:00
You should try to photograph people on bright sunny days because the light will be best a) true b) false
Answers: 1
question
Computers and Technology, 22.06.2019 02:30
Write a program that takes in 3 inputs [players (int type), expected game time (double type), team (char type)] and calculates actual game time (double) based on the following conditions: if the number of players or the expected game time is less than or equal to zero, it should output wrong input if the number of players is greater than 0 and less than or equal to 6 and if they are on the â€r’ or â€r’ team, their game time will be 10% faster. and if they are on the â€b’ or â€b’ team, their game time will be 15% faster. and if they are on the â€y’ or â€y’ team, their game time will be 20% faster. and if they are on any other team, they will play 0% faster. if the number of players is greater than 6 but less than or equal to 12 and if they are on the â€r’ or â€r’ team, their game time will be 20% faster. and if they are on the â€b’ or â€b’ team, their game time will be 25% faster. and if they are on the â€y’ or â€y’ team their game time will be 30% faster. and if they are on any other team, they will play 0% faster. if the number of players is greater than 12 but less than or equal to 18 and if they are on the â€r’ or â€r’ team, their game time will be 30% faster. and if they are on the â€b’ or â€b’ team, their game time will be 35% faster. and if they are on the â€y’ or â€y’ team, their game time will
Answers: 2
question
Computers and Technology, 22.06.2019 03:00
Check my work the microprocessor is a(n) circuit, which is designed to process data based on a set of instructions. most desktop and laptop devices contain a microprocessor based on the standard. most tablets and smartphones contain processors based on technology. a microprocessor's circuitry is designed to perform a limited number of tasks contained in its set. during processing, an instruction is loaded into the processor's unit. data is loaded into registers in the processor's where arithmetic and logic operations are performed. microprocessor performance can be measured by its speed. other factors affecting overall processing performance include word size, cache size, and instruction set complexity. most digital devices contain only one microprocessor chip, but today's multi- processors contain circuitry that supports parallel processing. computers contain various kinds of memory. random memory is a special holding area for data, program instructions, and the system. it stores data on a temporary basis until the processor makes a data request. ram is different from disk storage because it is , which means that it can hold data only when the computer power is turned on. computers also contain read- memory, which is a type of non-volatile memory that provides a set of "hard-wired" instructions, called the loader, that a computer uses to boot up.
Answers: 3
question
Computers and Technology, 22.06.2019 16:00
If a client wants to make minor edits, what should he/she use?
Answers: 3
You know the right answer?
Display the book with the longest title among the books whose bookType contain a specific substring....
Questions
question
History, 19.01.2021 22:00
Questions on the website: 13722363