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

QUESTION 11 The ability to reuse objects already defined, perhaps for a differen

ID: 3866899 • Letter: Q

Question

QUESTION 11

The ability to reuse objects already defined, perhaps for a different purpose, with modification appropriate to the new purpose, is referred to as:

inheritance

information hiding

redefinition

overloading

10 points   

QUESTION 12

Consider the class inheritance.

class B{
public:
B();
B(int nn);
void f();
void g();
private:
int n;
};

class D: public B
{
public:
D(int nn, float dd);
  void h();
private:
double d;
};

How many private members does an object of class D have?

1

4

2

0

10 points   

QUESTION 13

Which statement is incorrect?

When class D is derived from class B, the derived class is usually larger.

Constructors are inherited. After all something has to initialize the inherited variables.

If B is a base class of D, then D’s members cannot invoke private member functions of B without regard to the kind of inheritance.

If B is a base class of D, then D’s members cannot access the private data members of B without regard to the kind of inheritance.

10 points   

QUESTION 14

class B{
public:
B();
B(int nn);
void f();
void g();
private:
int n;
};

class D: public B
{
public:
D(int nn, double dd);
void h();
private:
double d;
};

How many public members does an object of class D have?

5

2

3

4

10 points   

QUESTION 15

Which statement is incorrect?

If class D is derived from class B, we speak of D as the derived class and B as the base class.

If class D is derived from class B, we speak of D as the child class and B as the parent class.

If class D is derived from class B then class D has only some of the members from B, and the additional members defined in D.

If class D is derived from class B, then we say that class D inherits from class B.

10 points   

QUESTION 16

What is required in order to find the root of a function by numerical methods?

The function value at the start of the interval and the function value at the end of the interval must be of the same sign

The number of iterations must be very large

The epsilon value must be very small

The function value at the start of the interval and the function value at the end of the interval must be of opposite signs

10 points   

QUESTION 17

Which numerical method was implemented in class?

Trapezoidal rule

Simpson rule

Regula falsi

Secant

10 points   

QUESTION 18

How many integration methods were explained in class?

3

1

4

2

10 points   

QUESTION 19

Which method is NOT used to find th root of an equation?

Bisection

Secant

Trapezoidal rule

Regula falsi

inheritance

information hiding

redefinition

overloading

Explanation / Answer

Question 11. Inheritance
Question 12. 1
Question 13. If B is a base class of D, then D’s members cannot invoke private member functions of B without regard to the kind of inheritance.

That is : its possible to invoke private member functions in derived class.


Question 14. 5
Question 15. If class D is derived from class B then class D has only some of the members from B, and the additional members defined in D
Question 16. The epsilon value must be very small
Question 17.
Which is the class referred here?

Question 18.
Which is the class referred here?

Question 19. Trapezoidal rule

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