Ok, here it is for your reference, and also I need to do the search in ISBN
number:
class bookType
{
public:
//this part is for the book title
string printTitle() const;
void setTitle(string );
void checkTitle(stri ng);
//this part is for the number of copies
int showNumCopies() const;
void setCopies(int);
void updateCopies(in t);
int printNumCopies( ) const;
//this part is for the publisher
string showPublisher() const;
void setPublisher(st ring);
void updatePublisher (string);
string printPublisher( ) const;
//this part is for the ISBN
string showISBN() const;
void setISBN(string) ;
void updateISBN(stri ng);
string printISBN() const;
//this part is for the price
double showPrice() const;
void setPrice(double );
void updatePrice(dou ble);
double printPrice() const;
//this part is for the authors
string showAuthors() const;
void setAuthors(stri ng, int);
void updateAuthors(s tring, int);
string printAuthors() const;
private:
string title;
string publisher;
string isbn;
double price;
int numInStock;
string authors[4];
};
string bookType::print Title() const
{
return title;
}
void bookType::setTi tle(string titleName)
{
title = titleName;
}
void bookType::check Title(string newTitle)
{
if(newTitle == title)
cout << "That title already exists." << endl;
}
int bookType::showN umCopies() const
{
return numInStock;
}
void bookType::setCo pies(int copiesIn)
{
numInStock = copiesIn;
}
void bookType::updat eCopies(int newNum)
{
numInStock = newNum;
}
int bookType::print NumCopies() const
{
return numInStock;
}
string bookType::showP ublisher() const
{
return publisher;
}
void bookType::setPu blisher(string publish)
{
publisher = publish;
}
void bookType::updat ePublisher(stri ng newPub)
{
publisher = newPub;
}
string bookType::print Publisher() const
{
return publisher;
}
string bookType::showI SBN() const
{
return isbn;
}
void bookType::setIS BN(string isbnIn)
{
isbn = isbnIn;
}
void bookType::updat eISBN(string newIsbn)
{
isbn = newIsbn;
}
string bookType::print ISBN() const
{
return isbn;
}
double bookType::showP rice() const
{
return price;
}
void bookType::setPr ice(double priceIn)
{
price = priceIn;
}
void bookType::updat ePrice(double newPrice)
{
price = newPrice;
}
double bookType::print Price() const
{
return price;
}
string bookType::showA uthors() const
{
return authors[0];
return authors[1];
return authors[2];
return authors[3];
}
void bookType::setAu thors(string authorIn, int authNum)
{
authors[authNum] = authorIn;
}
void bookType::updat eAuthors(string setAuthor, int authNum)
{
authors[authNum] = setAuthor;
}
string bookType::print Authors() const
{
return authors[0];
return authors[1];
return authors[2];
return authors[3];
}
"Jacques Labuschagne" <ja*****@clawsh rimp.com> wrote in message
news:OG******** *************@n ews.xtra.co.nz. ..
deanfamily wrote: Your suggestion I think works, but I need to know how to define getBook
in the area to define the class.
Why don't you post the code of your ADT so we have some context?
Jacques.