Question: Programming C + + using Linear Search with One Dimensional Array In this assignment, we will practice using Linear Search for a problem. Steps for

Programming C++ using Linear Search with One Dimensional Array
In this assignment, we will practice using Linear Search for a problem.
Steps for programming:
Write a C++ program named books.cpp;
Copy the data file booktitles.dat into your project directory.
What to include in "books.cpp" program:
The program reads the titles of a collection of books from a data file and stores them in an array.
This should be done using a User defined function named "ReadData". This function should have 3 parameters:
the input file stream,
the array of book titles, and
the number of books read from the file.
Then, the program sorts the titles in alphabetical order (use bubble sort) and printsout the list of book titles, one title per line,
Afterwards, the program goes into a query mode prompting the user to query whether a book is in the collection. If the book is in the collection, it display its location in the collection. If the book is not in th collection, inform the user about that. The query mode ends when the usr enters an empty string, i.e., simply press the "ENTER" key when prompted for book title.
Notice: The index of the first element in the array is 0. Yet, for the output, the value corresponding to the first book should be 1. Same goes for the location values returned in the query mode.
Here is an example run of the program:
 Programming C++ using Linear Search with One Dimensional Array In this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!