OK so I'm doing this assignment and i'm confuzzled:
write a basic class, with a constructor, default constructor, setter and getter functions. This is what I got:
class Car {
private:
int yearModel;
string make;
int mpg;
public:
Car(int, string, int); //constructor
void setDefault(int, string, int); // def constructor prototype
};
void car::setDefault (int a = 0; string ab = ""; int b = 30){ //def constructor definition
yearModel=a;
mpg=b;
make=ab;
}
Is that correct? How are getter and setter functions done? I've read the chapter twice, looked online and stumped HEEEEEEEEEEEEEEELLLLLLLLLLPPPPPPPPPP