Define a Class in C++. (BOOK)


Define a class BOOK in C++ with following description:

  • ·         BOOK_NO                Integer type
  • ·         BOOK_TITLE          20 characters
  • ·         PRICE                       float (price per copy)
  • ·         TOTAL_COST()        A function to calculate the total cost for N number of copies, where N is passed to the function as argument

Public members
  • ·         INPUT()                     Function to read BOOK_NO, BOOK_TITLE,PRICE
  • ·         PURCHASE()            Function to ask the user to input the number of copies to be purchased. It invokes TOTAL_COST() and  prints the total cost to be paid by the user.




No comments

Post your comments

Powered by Blogger.