Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

INSTRUCTIONS Every question is worth 2 points (unless otherwise noted) For multi

ID: 3593984 • Letter: I

Question

INSTRUCTIONS Every question is worth 2 points (unless otherwise noted) For multiple choice questions, choose THE SINGLE BEST ANSWER (unless otherwise noted). 1. What type of class variable is shared among all instances of a class? 2. This is a special function that is called whenever a new object is created and initialized with another object's data (for example: Date d2-d1y a. copy constructor b. assignment function c. destructor d. static function 3. If you do not provide one of these, a default will be provided for you by the compiler a. copy constructor b. destructor e. none of these c. default constructor d. all of these 4. What does it mean to overload a function? 5. The following allows us to create new classes based on existing classes. a. overloading b. encapsulation c. inheritance d. polymorphism What kind of function is called when an object is created? hat does it mean to redefine a function?

Explanation / Answer

1. The class variable shared among all the instances of class is called as static variable , It is unique to each of the instance of class . It is allocated at the compile time and initialized at the class initialization time .

2. A special function that is called whenever a new object is created and initialized with another object's data is called as copy constructor , It will share the name of the class and will have no return value , It can also have arguments and it can also be overloaded.

3. If you do not provide ny one of these , a default constructor will be provided by the compiler which will have an empty body , It will be called with no arguments and without any parameters .

4. The overloading of a function is used to define two or more functions having same name and same scope , it performs a single operation . A function can be overloaded by changing number of arguments or with different types of arguments .

5. Inheritance allows to create new classes based on existing classes , The parent class is called as base class and the new class is called as derived class .

6. A constructor subroutine is called when an object is created , A constructor will have the same name as the class , and it initailizes the object's data members.

7. The redefining of a function is a method which has different definition than a non virtual function in the ancestor class , and the compiler chooses the function to call based upon the static type of the object reference than the actual type of the object.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote