The following is a class diagram for class textBook and the main() program. The
class consists of 3 data members and 4 function members. Write a complete
C++ program that is able to do the following tasks:
textBook
bookName : char[]
bookPrice : float
totalInStock : int
Constructor
orderBook(int):void
checkQty() : float
printDetail() : void
main()
{
textBook classBook(“Learning C”,150.00,200);
textbook storyBook(“Upin Ipin”);
classBook.orderBook(20);
cout << “Total book in stock “ << storyBook.checkQty();
storyBook.printDetail();
:
}

This article has been dead for over six months. Start a new discussion instead.