Question: Please answer the following : Part 1: 1- What is correct about the static data member of a class? (A) A static member function can

Please answer the following :

Part 1:

1- What is correct about the static data member of a class?

(A) A static member function can access only static data members of a class.

(B) A static data member is shared among all the object of the class.

(C) A static data member can be accessed directly from main().

(D) Both A and B.

2- Which one of the following options is correct?

(A) Friend function can access public data members of the class.

(B) Friend function can access protected data members of the class.

(C) Friend function can access private data members of the class.

(D) All of the above.

Part 2:

- [15 points] consider the following list of classes: Car, SteeringWheel, Vehicle, Van, Minivan, AudioSystem, and ParkingLot. Your task is to describe all of the (is-a) and (has-a) relationships between these classes. Include an inheritance hierarchy for all classes that fit.

Part 3:

- [25 points] write a template class Point with two class parameters representing the two coordinates of the Point. Include public methods to display and set the data values as well as a function that swaps the values so that, after the swap, the first element is cast into the second and the second is cast into the first. Also write a main function that creates a Point object and calls the public methods.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!