Complete the code to declare a constructor for the class.
class Car { public: [1]() { speed = 0; } private: int speed; };
The constructor must have the same name as the class, which is Car.
Complete the constructor to initialize the member variable 'speed' with the given value.
class Car { public: Car(int s) { [1] = s; } private: int speed; };
s instead of the member variable.this-> which can cause confusion.Using this->speed clearly refers to the member variable speed of the object.
Fix the error in the constructor declaration to properly initialize 'speed'.
class Car { public: Car(int s) : [1](s) {} private: int speed; };
The member initializer list must use the member variable name speed to initialize it.
Fill both blanks to create a constructor that sets 'speed' and 'color' with given values.
class Car { public: Car(int s, std::string c) : [1](s), [2](c) {} private: int speed; std::string color; };
The initializer list must use member variable names speed and color to initialize them.
Fill all three blanks to create a constructor that initializes 'speed', 'color', and 'model'.
class Car { public: Car(int s, std::string c, std::string m) : [1](s), [2](c), [3](m) {} private: int speed; std::string color; std::string model; };
The constructor's initializer list must use the member variable names speed, color, and model to initialize them.