Question: Write statements to create a class called Transport with: a public Mutator function (like: set ()) to change the private variable a public Accessor' function
Write statements to create a class called Transport with: a public "Mutator" function (like: set ()) to change the private variable a public "Accessor' function (like: get ()) to access private variable The class has a private member variable wheels'. It has no constructor function. Define the above functions. Create two objects (car, bicycle) of this class. Set the wheels' to 4 and 2, respectively, for these objects using the "Mutator function. Then print the values of wheels' for both objects using the Accessor function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
