1-(check)Every object can call the access functions. Select one: True False 2-(check)A friend function can access the non public members of a class. Select one: True False 3-(check)The data members of...

c++


1-(check)Every object can call the access functions. Select one: True False 2-(check)A friend function can access the non public members of a class. Select one: True False 3-(check)The data members of a class are private by default. Select one: True False 4-When a class is a base class you required to define the data members as______rather than private, Select one! a, public b. virtual c. private d. protected 5-Inheritance relationship is said to be: Select one: a. None b. Is-A(– Composition, or aggregation: (“has-a” relationship) – Inheritance (“is-a” relationship) C++) c. Has-A d. Association 6-(check)To handle a thrown value you should write a---- block in your program before the end of main function Select a. catch b. try e exit d. Throw 7-(check)To create a class Student that derives from the class Person you should write the following syntax: class Student………..public Person Select one: a. : b.; C . - > d. : : 8-…….means that one or more of data members in a class are objects of another class data type. Select one: a. templates b. none of them c. Inheritance d. composition 9-The %operator() function overloads the modulus operator. Select one: True False 10-The member functions of a class should return same data type. Select one: True False 11-(check)we can overload prefix increment as a function in public part and we can overload it as friend function. Select one: True False 12-When class Z inherit from class Y and class Y inherit from class X , this type of inheritance called: Select one: a. Multiple Inheritance b. Hierarchical Inheritance c Single inheritance .d. Protected inheritance 13-Suppose you have a class called Numbers and you define three objects as bellow and you want to overload Addition operator ( + ) as bellow, which of the following definitions is correct: Numbers operator+(Numbers &c) (Numbers z(num2 - c.num1, num1*c.num2); return z; } Numbers operator+(Numbers &c) (Numbers z(num1 + c.num1,num2+c.num2); return z; } Numbers operator+(Numbers &c) {Numbers z(num1 * c.num2,num2-c.num1); return z; } Numbers operator+(Numbers &c) {Numbers z(num1 * c.num1, num2-c.num2); return z; } 14->> operator called Extraction operator Select one: True(< is insertion="" operator.="">> is extraction operator.) False 15-A……….class is also called subclass or descendant, Select one: a. main b. derived c. base d. parent 16-The order of constructors callings for the following program is: Select one: base2 constructor , base1 constructor , derived constructor derived constructor, base2 constructor ,base1 constructor derived constructor, base1 constructor , base2 constructor base1 constructor , base2 constructor , derived constructor 17-How many errors in the following program:" Select one: . Two errors . Three errors . one error . there are no errors 18-(check)In c++, we can use………. to allow function accept parameters with different data types. Select one: . a. copy constructor . b. templates c. constructor d. function overloading 19-Given the following code after we execute it the output will be: 27 20-(check)………is the process of responding to the occurrence of errors. Select one: a. Exceptions Handling b. Virtual Function c. Function Overriding d. Polymorphism 21-The operator++() function overloads the prefix decrement operator. Select one: True False 22-A…… is a function that have the same name of the class. Select one: a. virtual b. function c. access d. constructor 23-The sequence of calling destructor for any array of objects is from last object back to the first. Select one: True False 24- 25-The declaration of a struct allocates memory for each data member of the struct. Select one: True False 26-A class can have more than one destructor. Select one: True False 27-(check)Copy constructor is a function that have the same name of the class and have a parameter from the same type : Select one : True False 28-(check)The private part of a class can't contain any functions. Select one: True False 29-A struct is an ADT that can't contain different data types. Select one: True False 30-An object is accessed using the name of the class. Select one: True False 31-The block of a class should end withSemicolon. Select one: True False 32-The compiler will generate a default constructor if you didn't define any constructor. Select one: True False 33-The order that struct data member are defined dose not affect the order in which they are accessed. Select one: True False 34-A struct is accessed by the struct variable name, the name of the struct, and the struct member name True False 5.A class is a.     A structured data type b.    A homogenous data type c.    A simple data type 6.All data members of a class must be of the same data type. a.     true b.    false 7.You define an object of a class in the same way that you define a variable of a data type. a.     true b.    false 8.It is optional to initialize an object at declaration. a.     true b.    false 9.A data member is another term for an object. a.     true b.    false
Jul 31, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here