I need to create a class (named: Lamp) with a default constructor, a constructor with parameters for each data member, and the following public data members:
"style, which is a string (initialize to "Plain")
color, which is a character (initialize to 'N').
wattage, which is a floating point value (initialize to 0).
bulbs, which is an integer value (initialize to 1)."
My second constructor also need to take all data member variables as input in the order they are specified above.
this is my code, it builds but the auto grader says it's not right
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
class Lamp
{
public:
string style;
char color;
float wattage;
int bulbs;
public:
Lamp() : style("Plain"), color('N'), wattage(0), bulbs(1)
{
}
};
|
any ideas people?