Create A Class Called Book In Microsoft Visual C++?

Create a class called Book that represents the Books data in a Book Store. (NOTE: place the class in a separate file “Separate the interface from the implementation”).
The system keeps the following data about each book “ISBN (code of book), title, author name and price”.
The class should have the following member functions:
• a constructor that initializes the data members to given parameters.
• Setter and getter function for each data member.
o NOTE: in setPrice: check if the price is not positive, set it to 0.
• A function readFromKbd for interactive entry from the keyboard with prompts. (HINT: use the setter).
• Function CalculateDiscount, which calculates the final price after discount, based on the following:
if the price is less than 200, the discount rate will be 25%. Otherwise, the discount rate will be 50%. (HINT: what should you use setters or getters?).
• Function displayBookInfo, which displays the following: (HINT: use the getters).
**************Book Information *************
Book ISBN: ………………
Book Title: ………………
Author name: ………………..
Original Price: ………………….
**************************************…
• Print the new price after discount (in the main).
Write a main () function to test your class.

Both comments and pings are currently closed.

Comments are closed.

Powered by WordPress | Designed by: free css template | Thanks to hostgator coupon and web hosting reviews