Computers and Technology
Computers and Technology, 30.03.2021 20:10, cuavang55

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 16:00, trapqueenriz12
Ramon is graphing the function  f(x) = 3(4)x. he begins by plotting the initial value. which graph represents his initial step?
Answers: 2
image
Computers and Technology, 22.06.2019 10:00, kimmmmmmy333
According to alisa miller foreign news bureaus
Answers: 3
image
Computers and Technology, 22.06.2019 17:40, lazerlemon500
Write a modular program (no classes yet, just from what you learned last year), that allows two players to play a game of tic-tac-toe. use a two-dimensional char array with 3 rows and 3 columns as the game board. each element of the array should be initialized with an asterisk (*). the program should display the initial board configuration and then start a loop that does the following: allow player 1 to select a location on the board for an x by entering a row and column number. then redisplay the board with an x replacing the * in the chosen location. if there is no winner yet and the board is not yet full, allow player 2 to select a location on the board for an o by entering a row and column number. then redisplay the board with an o replacing the * in the chosen location. the loop should continue until a player has won or a tie has occurred, then display a message indicating who won, or reporting that a tie occurred. player 1 wins when there are three xs in a row, a column, or a diagonal on the game board. player 2 wins when there are three ox in a row, a column, or a diagonal on the game board. a tie occurs when all of the locations on the board are full, but there is no winner. input validation: only allow legal moves to be entered. the row must be 1, 2, or 3. the column must be 1, 2 3. the (row, column) position entered must currently be empty (i. e., still have an asterisk in it).
Answers: 1
image
Computers and Technology, 23.06.2019 23:00, GreenHerbz206
Computer programming is one type of what career
Answers: 1
Do you know the correct answer?
Display the book with the longest title among the books whose bookType contain a specific substring....

Questions in other subjects:

Konu
Mathematics, 10.02.2021 07:30
Konu
English, 10.02.2021 07:30
Konu
Chemistry, 10.02.2021 07:30