Complete the code to declare a constructor that takes no arguments.
class Box { public: Box() [1] {} };
The constructor initializes width, height, and depth to 0 using an initializer list.
Complete the code to declare a constructor that takes three integer parameters.
class Box { public: Box(int w, int h, int d) [1] {} };
The constructor assigns the parameters to the class members inside the constructor body.
Fix the error in the constructor declaration to properly overload it.
class Box { public: Box() {} Box(int w, int h, int d) [1] {} };
The constructor must have the same name as the class and no return type to overload properly.
Fill both blanks to complete the constructor initializer list and body.
class Box { int width, height, depth; public: Box(int w, int h, int d) [1] [2] {} };
The initializer list sets the members before the constructor body, which is empty here.
Fill all three blanks to complete the overloaded constructors with default values.
class Box { int width, height, depth; public: Box() [1] {} Box(int w) [2] {} Box(int w, int h, int d) [3] {} };
Each constructor uses an initializer list to set member variables with appropriate default or given values.