Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a Textbook Information Viewing program. This project requires a user-defined struct type A book.h header file, declared below, is used to represent each

image text in transcribedimage text in transcribedimage text in transcribed

C++

Write a Textbook Information Viewing program. This project requires a user-defined struct type A book.h header file, declared below, is used to represent each textbook record in the system and functions that you need to implement. Implement the declared textbook functions in a file named book.cpp. Develop a program, name proj01.cpp, to read from input textbook data record file and create a list of textbook records. The input data file can store up to 35 textbook records. This program can perform 2 functions List: to list all the textbook records read from the input file Find: to lookup a specific textbook record by the input ISBN number. The ISBN number is an alphanumeric value . Your program will read all input from the command line, no prompting for user input and hardcoding for input file name. The required program output is provided below Declaration of Book struct: // @file book.h #ifndef BOOK H #define BOOK H #include namespace std const int MAX AUTHORS 20; struct Book string title; string authors [MAX AUTHORS] short authorCount; string publisher; short yearPublish; bool hardcover; float price; string isbn; long copies; @param filename name of the input data file @param books an array of textbook records read from the file *return the number of textbook records read int read (string filename, Book books [1) Gparam id the ISBN number to search for *@param books the list of textbook records @param length the number of textbook records in the array * @return the array index f the matching rec rd, the rise it returns -1 int find (string id, Book books [], int length) tendif / BOOK H*/ Example Output: s cat book.dat C++ Network Programming Volume 1 Douglas c. Schmidt Stephen D. Huston Addison-Wesley 2002 35.99 0-201-60464-7 236 Programming Ruby David Thomas Andrew Hunt Addison-Wesley 2001 42.95 0-201-71089-7 123 Problem Solving with C++- The object of Programming 1 Walter Savitch Addison Wesley Longman, 2001 Inc. 74.00 0-201-70390-4 325 % . /proj 01 ./projo1 find ./proj01 list % ./proj 01 books . dat list Title: C++ Network Programming-Volume 1 Author: Douglas C. Schmidt Author: Stephen D. Huston Publisher: Addison-Wesley Year: 2002 Cover Paperback Price: $35.99 ISBN: 0-201-60464-7 Copies: 236 Title: Programming Ruby Author: David Thomas Author: Andrew Hunt Publisher: Addison-Wesley Year: 2001 Cover: Paperback Price: $42.95 ISBN: 0-201-71089-7 Copies: 123 % ./proj 01 books .dat find 0-201-60464-7 ISBN: 0-201-60464-7FOUND Title: c++ Network Programming - Volume 1 Author Douglas C. Schmidt Author Stephen D. Huston Publisher: Addison-Wesley Year 2002 Cover: Paperback Price: $35.99 ISBN: 0-201-60464-7 Copies 236

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

Students also viewed these Databases questions

Question

Decision Making in Groups Leadership in Meetings

Answered: 1 week ago