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();
:
}
accy 0 Newbie Poster
kvprajapati 1,826 Posting Genius Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.