2.2.1 The class shall contain the following private variables: (1) a character array called m_sName, (2) a long called m_lStockNum, (3) an integer called m_iClassification, (4) a double called m_dCost, and (5) an integer called m_iCount. Details of these variables are defined below.
2.2.1.1 m_sName--This character array shall be 128 bytes in length and will be used to store the name of a book or periodical.
2.2.1.2 m_lStockNum--This long shall be used to store a unique stock number for the book or periodical. This will be used as the key in any store, search, or retrieval operation.
2.2.1.3 m_iClassification--This integer will be used to code specific information about the book or periodical.
2.2.1.4 m_dCost--This double will be used to store the cost of this book or periodical.
2.2.1.5 m_iCount--This integer will be used to store the number of copies of this item currently in the inventory.
2.2.2 The class shall contain the following public functions: a constructor and destructor and get and set functions for each of the variables. These functions shall work as described in the following paragraphs.
2.2.2.1 BookRecord()--The default constructor shall set the member variables to the following initial values: m_sName = "", m_lStockNum = 0, m_iClassification = 0, m_dCost = 0.0, and m_iCount = 0.
2.2.2.2 BookRecord(char *name, long sn, int cl, double cost)--This constructor shall set the member variables to the values passed into the function and initialize the m_iCount variable to one (1).
2.2.2.3 ~BookRecord()--The destructor shall be an empty, place-holder function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
class BookRecord
{
private:
char m_sName[128];
long m_lStockNum;
int m_iClassification;
double m_dCost;
int m_iCount;
public:
BookRecord()
{
m_sName[128];
m_lStockNum = 0;
m_iClassification = 0;
m_dCost = 0.0;
m_iCount = 0;
}
BookRecord(char *name, long sn, int cl, double cost)
{
m_iCount;
}
~BookRecord()
{
}
|
This is suppose to be my header file I am wondering if this is correct?