Given the following class definition, how would you declare an object of the class, so that the object automatically called the default constructor?
class ItemClass
{
public:
ItemClass();
ItemClass(int newSize, float newCost);
int getSize();
float getCost();
void setSize(int newSize);
void setCost(float newCost);
private:
int size;
float cost;
};
a. ItemClass() myItem;
b. ItemClass myItem(1, 0.0);
c. ItemClass myItem;
d. ItemClass myItem();
e. You can not do this
c. ItemClass myItem;
Computer Science & Information Technology
You might also like to view...
In Impress, a(n) ________ is a preformatted area that determines the type of information to place in an area of a slide
Fill in the blank(s) with correct word
Computer Science & Information Technology
Styles that remain the same in all of the layouts are placed inside of the media queries.
Answer the following statement true (T) or false (F)
Computer Science & Information Technology