Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++, class members are private by default. A. true B. false In C++, destructors may return a value. A. true B. false In C++,

In C++, class members are private by default.

A. true

B. false

In C++, destructors may return a value.

A. true

B. false

In C++, pointers can be used as array names.

A. true

B. false

Public members of a public base class become protected members of the derived class.

A. true

B. false

A member function of a derived class may have the same name as a member function of the base class.

A. true

B. false

C++ allows you to pass an object of a derived class as an argument to a function where the parameter is of base class type.

A. true

B. false

A class containing one or more pure virtual functions is an abstract class and cannot be instantiated.

A. true

B. false

The compiler creates an instance of a function template in memory as soon as it encounters the function template definition.

A. true

B. false

Here is a function prototype and some possible function calls:

double sumOfThreeNumbers(double = 1.0, double = 2.0, double = 3.0);

// Possible function calls:

cout << sumOfThreeNumbers ();

cout << sumOfThreeNumbers (2.3);

cout << sumOfThreeNumbers ( , 1.7, -3);

cout << sumOfThreeNumbers (2.3, , -3);

How many of the above function calls are legal?

1 of them is legal.

B. 2 of them are legal.

C. 3 of them are legal.

D. All of them are legal.

Here is the start of a class declaration:

class ClassA

{

public:

void func1(const ClassA& a);

void func2(const ClassA& a) const;

void func3(ClassA a) const;

...

Which of the three member functions can alter the private member variables of the ClassA object that activates the function?

None of the three functions.

Only func1.

C. Only func2.

D. Only func3.

E. Only two of the three functions.

Given a C-string defined by

char name[8] = {'M', 'i', 'k', 'e', '\0'};

which of the following integers will be returned by strlen(name)?

A. 3.

B. 4.

C. 5.

D. 8.

Here is the prototype for a template function:

template

void func(Item x);

Which is the right way to call the func function with a double argument a?

A. func( a );

B. func( a );

C. func( a );

D. func( a );

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago