Question: The input file for this program is here: books.txt darr. This is a text file that consists of individual entries describing 1 0 0 books,
The input file for this program is here: books.txt darr.
This is a text file that consists of individual entries describing books, in a modified format based on a popular book recommendation dataset
A single book entry consists of separate lines, each describing a characteristic, as described in this diagram.
Each book is described by lines in books.txt:
Read the file into an array or vector of these structures.
A good way to read an entire entry is to call getline times notice that some fields can contain spaces
Step : Sorting the array
ISBN field of struct Book. All other fields can be ignored for the purposes of the sort. You can do the sort with a function or directly in main
Complete the sort before prompting the user in the next step.
Step : Prompt the user for a search key, search the array
Enter a loop and prompt the user to enter an ISBN number. Use this number as the key to search in the array or vector
If the book is matching that ISBN is found, print all of the information from the struct, with a header identifying each field, like in the below example.
If the book was not found, print 'Not found' or a similar message.
Continuously loop for input until the user types a sentinel value such as a blank line or
Other Notes
Here are the other requirements and notes:
Your cpp file should have C implementations of binary search and bubble sort see examples Do not use any library functions for these.
No dynamic memory is needed for the arrayvector storage. The input file contains books, it is OK to use a fixedsize array of structures or a vector
The output should be formatted similar to the above example and easily readable do not print the entire book on one line without headers, etc.
Use the input file as provided, no reformatting.
All of this program can be completed only with the syntax and topics we've covered so far in this class. Additional library functions or data types are not needed.
Example
Here is an example run for a successful and unsuccessful search. Your output does not need to exactly match, but it should be similar. Print each characteristic of the book on a separate line.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
