Question
[50 pts] Write a C++ program that reads the following list of input data (book.dat) into an array of Book class objects. This program should
[50 pts] Write a C++ program that reads the following list of input data (book.dat) into an array of Book class objects. This program should allow users to search and view the books from a Menu with the following options: 1. List all available books 2. Search for book using A. Title or B. ISBN? 3. Exit Program The format of the file is as follows: // The title of the book // The ISBN of the book // The Book Publisher // The year it was published // The authors of the book // The cost of the book // The number of copies of the book // The number of authors // List of Authors. book.dat C++Programing: From Problem Analysis to Program Design 5-17-525281-3 ABC 2000 52.50 20 1 Malik, D.S. Fuzzy Discrete Structures 3-7908-1335-4 Physica-Verlag 2000 89.00 10 2 Malik, Davender CSC234 Advanced C++ Lab 2: Chapters 9-10 4 Mordeson, John Fuzzy Mathematic in Medicine 3-7908-1325-7 Physica-Verlag 2000 89.00 10 3 Mordeson, John Malik, Davender Cheng, Shih-Chung Harry John and The Magician 0-239-23635-0 McArthur A. Devine Books 1999 19.95 10 3 Goof, Goofy Pluto, Peter Head, Mark Dynamic InterWeb Programming 22-99521-453-1 GNet 1998 39.99 25 1 Dimitri P. Bertsekas Use the following functions in your program driver program. //Function Reads the input data file void getBookData(Book books[], int& noOfBooks); //Function Displays the list of book information void printBookData(Book books[], int noOfBooks); //Function Searches for book based on book title or ISBN void searchBookData(Book books[], int bookCount); //Function searches list of books based on book ISBN and //returns the location (index) of the found book. void searchBookDataByISBN(Book books[], int bookCount, string ISBN,int& loc); CSC234 Advanced C++ Lab 2: Chapters 9-10 5 //Function searches list of books based on book title and //returns the location (index) of the found book. void searchBookDataByTitle(Book books[], int bookCount, string title, int& loc); HINT: Define a class Book with all the data members and member functions for accessing and setting the data members. All data members should be private. No non-constant data should be declared globally
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started