Which of the following base class members is never inherited by a derived class,
ID: 3635816 • Letter: W
Question
Which of the following base class members is never inherited by a derived class, regardless of access attributes? (Points : 4)Mutator
Data
Accessor
Destructor
10. (TCO 5) If p is a dynamic array, which statement deallocates the memory occupied by p? (Points : 4)
delete p;
delete *p;
delete [p];
delete [] p
11. (TCO 5) Given the declaration:
int num = 6;
int *p = # (Points : 4)
p++;
(*p)++;
(*num)++;
p&num++;
12. (TCO 5) What will be the output of the following code snippet?
int value = 10;
int *iptr = &value;
*iptr = 5;
cout << *iptr << " " << value; (Points : 4)
5 5
10 10
5 10
None of the above: it will cause a compile error.
13. (TCO 5) Given a pointer variable called myData which points to an instance of the following structure, which of the following statements assigns the value 123.45 to the dval field of the structure?
struct Data
{
int ival;
double dval;
char cval;
};
(Points : 4)
dval = 123.45;
*mydata = 123.45;
mydata->dval = 123.45;
mydata.dval = 123.45;
1. (TCO 4) Which of the following class definitions makes the public members of the class aClass become the public members of the class bClass? (Points : 4)
class aClass: public bClass{ //...};
class bClass: public aClass{ //...};
class bClass: aClass{ //...};
class aClass: bClass{ //...};
2. (TCO 6) Which of the following operators can be overloaded? (Points : 4)
.
.*
::
++
3. (TCO 6) Which of the following is the general syntax to overload the post-increment operator as a member function? (Points : 4)
className operator++();
friend className operator++();
className operator++(int);
fiend className operator++(int);
4. (TCO 6) An example of a unary operator is (Points : 4)
-
+
*
/
5. (TCO 6) If a class has pointer data members, it should (Points : 4)
overload the assignment operator and define the copy constructor.
not overload any operators.
overload only the assignment operator.
overload the assignment operator, but not define the copy constructor.
6. (TCO 6) Including the const keyword before the parameter of an overloaded operator will (Points : 4)
cause a compiler error.
prevent the operator from changing the value of the parameter.
prevent the operator from changing the value of the parameter only if it is an object of the same class in which the overloaded operator is defined.
only be used when overloading the assignment operator.
7. (TCO 7) Static binding is a process which is (Points : 4)
performed during run-time operation of the program.
performed during the linking operation of the program.
performed during the compilation of the program.
performed only when the static option is set in the compile options.
8. (TCO 7) Overriding a base class member function with a derived member function demonstrates the concept of (Points : 4)
overloading.
inheritance.
polymorphism.
abstraction.
9. (TCO 7) Virtual functions are reserved using what C++ keyword? (Points : 4)
Polymorphic
Static
Dynamic
Virtual
10. (TCO 7) If class Shape is an abstract class, what type of variable may be declared of type Shape? (Points : 4)
No variables may be declared because it is an abstract class.
Only arrays of the class Shape may be declared.
Objects of class Shape may be declared only if an object of a class derived from Shape is also declared.
A pointer of the abstract class may be declared.
11. (TCO 7) If a function is declared virtual in a base class then (Points : 4)
it must also be declared as virtual in any derived class.
it must not be overridden in any derived classes.
it remains virtual even if a derived class overrides it and does not declare it as virtual.
it must be overridden in any and all derived classes.
12. (TCO 8) In a multi-file, object-oriented C++ project, which file contains the class definition? (Points : 4)
classname.cpp
classname.h
classname.def
classname.hdr
13. (TCO 8) Which is a correct preprocessor directive statement? (Points : 4)
define PI = 3.141593
define PI = 3.141593;
#define PI 3.141593
#define PI = 3.141593
14. (TCO 8) Which preprocessor directive essentially inserts another file into your source file? (Points : 4)
ifndef
define
include
fstream
Explanation / Answer
Dear,
10) delete p;
11)In order to increment the num value
(*p)++;
12) The output of the following code snippet 10 10
13)mydata->dval = 123.45;
1)class bClass: public aClass{ //...};
2)++ operator overloads
3)fiend className operator++(int);
4)+ is unary operator
5)overload the assignment operator and define the copy constructor
6)prevent the operator from changing the value of the parameter
7) performed during the compilation of the program.
8) polymorphism.
9) Virtual
10) Objects of class Shape may be declared only if an object of a class derived from Shape is also declared
11)it must be overridden in any and all derived classes.
12) classname.cpp class definition
class declaration is done in classname.h
13)#define PI 3.141593
14) include
Hope this will help you.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.