Design a class bookType that defines a book as a class. a. Each object of the class bookType will hold the following information about a book: title number of authors up to four authors publisher year published ISBN 13 (with dashes) price number of copies in stock (may be 0)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Design a class bookType that defines a book as a class.

a. Each object of the class bookType will hold the following information about a book:

title

number of authors

up to four authors

publisher

year published

ISBN 13 (with dashes)

price

number of copies in stock (may be 0)

b. Include the member functions to perform the various operations on objects of type bookType: Include individual get and set functions for all member variables.

c. Add a member function to update the number of copies in stock.

d. Add the appropriate constructors and a destructor (if one is needed). Ensure a default constructor is coded and the constructor initializes all data members. Remember, an array of classes uses a default constructor only.

e. ALL member variables must be private and accessed through member functions. The main client program CANNOT access the variables directly.

f. Ensure the class declaration and class implementation files are in separate header and code (.cpp) files. This assignment will require the creation of a project.

g. Write a client program that uses the class bookType and tests various operations on the objects of the class bookType. Declare an array of 50 components of type bookType in the client program.

h. Using a function, open the attached datafile (bookData.txt). Request the file name from the user. If the file does not open, display a proper message and exit the program. The file open should be in main and test a return value of success or failure.

i.Use a function and the attached datafile (bookData.txt) to initially load the data. The data file is of the form:

Book Title

ISBN

Publisher

Year Published

Cost

Number In Stock

Number of Authors

List of Authors

j.Read until end of file. Do not hardcode and use the actual number of books as the maximum (limiting factor) for the array of books. Keep a count of actual rows read and pass into and out of any functions and processes.

k. Have the program provide the following capabilities (by user request):

Through a menu system provide the capability to:

1) Search for a book by ISBN, Author or Book title. If the store sells the book, return an appropriate message. If the store does not sell the book, return an appropriate message. If the store sells the book, print the Title, authors, ISBN, publisher, price and the number in stock for the book.

2) Print a list of ALL the books in stock. This list will include all the information available for a book. A book is in stock when the number in stock is greater than 0.

3) Update the number of copies in stock. The user may search for the book using one of the capabilities indicated in (1) (by ISBN, Author or Title) and add to the number of copies by the number entered. This will simulate the process of restocking.

4) Print a list of ALL the books the store sells, even if not in stock at the time. The list will include all the information available for a book.

5) The user may exit the program by keying in an exit command or choice determined by you.

l.Place all function prototypes and const variables for the client program in a different header file than the class header file. Include the header file in the client program.

m. Include error checking (invalid menu choices, file open errors, etc.)

n. Once your class is declared and defined and your client program written, test each of the menu options to ensure proper processing and program behavior.

All classes must have a class definition header file (*.h) and a class implementation file (*.cpp). You must have a main program that exercises these classes (*.cpp). You must create a project in the IDE of your choice.

 

Please show the output of the program too

Thank you

Here is the transcribed list of educational texts along with their publication details:

1. **Computer Science Data Representation and Manipulation**
   - ISBN: 978-0-558-02409-3
   - Publisher: Pearson Custom
   - Year: 2008
   - Price: $47.95

2. **C++ For Engineers and Scientists**
   - ISBN: 978-1-133-18784-4
   - Publisher: Cengage
   - Year: 2013
   - Price: $102.00
   - Authors: Bronson, Gary J.; Lee, Marie

3. **Psychology**
   - ISBN: 978-1-121-72877-6
   - Publisher: McGraw Hill
   - Year: 2013
   - Price: $57.00

4. **Personality Study Guide**
   - ISBN: 978-0-495-90990-3
   - Publisher: Wadsworth
   - Year: 2011
   - Price: $19.95
   - Authors: Sungmal, Patricia; Cross, Christopher; Jones, Sharon

5. **The Essentials of Computer Organization and Architecture**
   - ISBN: 978-1-284-00343-7
   - Publisher: Jones and Bartlett
   - Year: 2015
   - Price: $132.00
   - Authors: Burger, Jerry M.; Wilson, Thomas L.

6. **The Passage**
   - ISBN: 978-0-345-50496-8
   - Publisher: Ballantine Books
   - Year: 2010
   - Price: $17.78
   - Author: Null, Linda

7. **Moby-Dick**
   - ISBN: 978-1509826643
   - Author: Cronin, Justin

These texts are useful resources for students and educators in computer science, engineering, psychology, and literature fields.
Transcribed Image Text:Here is the transcribed list of educational texts along with their publication details: 1. **Computer Science Data Representation and Manipulation** - ISBN: 978-0-558-02409-3 - Publisher: Pearson Custom - Year: 2008 - Price: $47.95 2. **C++ For Engineers and Scientists** - ISBN: 978-1-133-18784-4 - Publisher: Cengage - Year: 2013 - Price: $102.00 - Authors: Bronson, Gary J.; Lee, Marie 3. **Psychology** - ISBN: 978-1-121-72877-6 - Publisher: McGraw Hill - Year: 2013 - Price: $57.00 4. **Personality Study Guide** - ISBN: 978-0-495-90990-3 - Publisher: Wadsworth - Year: 2011 - Price: $19.95 - Authors: Sungmal, Patricia; Cross, Christopher; Jones, Sharon 5. **The Essentials of Computer Organization and Architecture** - ISBN: 978-1-284-00343-7 - Publisher: Jones and Bartlett - Year: 2015 - Price: $132.00 - Authors: Burger, Jerry M.; Wilson, Thomas L. 6. **The Passage** - ISBN: 978-0-345-50496-8 - Publisher: Ballantine Books - Year: 2010 - Price: $17.78 - Author: Null, Linda 7. **Moby-Dick** - ISBN: 978-1509826643 - Author: Cronin, Justin These texts are useful resources for students and educators in computer science, engineering, psychology, and literature fields.
**Books Catalog**

1. **Title**: Macmillan Collector's Library; Reissue edition  
   - **Publication Year**: 2016  
   - **Price**: $14.99  
   - **Quantity in Stock**: 0  
   - **Edition Number**: 1  

2. **Title**: Thinking in Java  
   - **Author**: Bruce Eckel  
   - **ISBN**: 978-0-567-55555-9  
   - **Publisher**: Prentice Hall  
   - **Publication Year**: 2017  
   - **Price**: $67.89  
   - **Quantity in Stock**: 2  
   - **Edition Number**: 1  
   - **Author**: Herman Melville  

*Note: Each entry contains detailed information about the edition, price, stock, and edition number for easy reference.*
Transcribed Image Text:**Books Catalog** 1. **Title**: Macmillan Collector's Library; Reissue edition - **Publication Year**: 2016 - **Price**: $14.99 - **Quantity in Stock**: 0 - **Edition Number**: 1 2. **Title**: Thinking in Java - **Author**: Bruce Eckel - **ISBN**: 978-0-567-55555-9 - **Publisher**: Prentice Hall - **Publication Year**: 2017 - **Price**: $67.89 - **Quantity in Stock**: 2 - **Edition Number**: 1 - **Author**: Herman Melville *Note: Each entry contains detailed information about the edition, price, stock, and edition number for easy reference.*
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education