Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in C++ Proof: a. Some of the characteristics of a book are the title, author(s), publisher, ISBN, price, and year of publication. Design a

Code in C++

Proof:

a. Some of the characteristics of a book are the title, author(s), publisher, ISBN, price, and year of publication. Design a class bookType that defines the book as an ADT. i. Each object of the class bookType can hold the following information about a book: title, up to four authors, publisher, ISBN, price, and number of copies in stock. To keep track of the number of authors, add another member variable. ii. Include the member functions to perform the various operations on objects of type bookType. For example, the usual operations that can be performed on the title are to show the title, set the title, and check whether a title is the same as the actual title of the book. Similarly, the typical operations that can be performed on the number of copies in stock are to showthe number of copies in stock, set the number of copies in stock, update the number of copies in stock, and return the number of copies in stock. Add similar operations for the publisher, ISBN, book price, and authors. Add the appropriate constructors and a destructor (if one is needed). b. Write the definitions of the member functions of the class bookType.

Need:

c. Write a program that uses the class bookType and tests various operations on the objects of the class bookType. Declare an array of 100 components of type bookType. Some of the operations that you should perform are to search for a book by its title, search by ISBN, and update the number of copies of a book.

My code (in C++) so far:

#include

using namespace std; class booktype { public: string title,authors[4],publisher,isbn; double price; int year_pub,num_authors,num_stock; public: booktype(string t,string author,string publisher); void showtitle(); void readauthors(int n); void setprice(double p); void showprice(); void shownum_stock(); void setnumstock(int n); }; booktype::booktype(string t,string isbn,string publisher) { title=t; this->isbn=isbn; this->publisher=publisher; } void booktype::showtitle() { cout<< "title"<4) { cout<< "number of authors exceeded"<>s; authors[i]=s; } cout<<"list of authors"<

void booktype::setprice(double p) { price=p; } void booktype::showprice() { cout<<"price"<

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

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

Students also viewed these Databases questions

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago