Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 1 Lnai 9851

Authors: Paolo Frasconi ,Niels Landwehr ,Giuseppe Manco ,Jilles Vreeken

1st Edition

3319461273, 978-3319461274

More Books

Students also viewed these Databases questions

Question

When will I do them?

Answered: 1 week ago