Complete the code to declare a private member variable in a class.
class Person { private: int [1]; };
The private member variable should be named age to store the person's age.
Complete the code to define a public getter method for the private variable.
class Person { private: int age; public: int [1]() { return age; } };
The getter method should be named getAge to return the private variable age.
Fix the error in the setter method to properly set the private variable.
class Person { private: int age; public: void setAge(int [1]) { age = [1]; } };
The parameter should have a different name like newAge to avoid confusion and correctly assign the value.
Fill both blanks to complete the setter method using the 'this' pointer.
class Person { private: int age; public: void setAge(int [1]) { this->[2] = [1]; } };
The parameter is named newAge and the member variable age is set using this->age.
Fill all three blanks to create a class with private member, public getter, and setter methods.
class Car { private: int [1]; public: int get[2]() { return [1]; } void set[2](int value) { this->[1] = value; } };
The private member is speed, the getter and setter use Speed with capital S for method names.