Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. A C++ class is similar to one of these. a. inline function b. header file c. library function d. structure e. none of these

1. A C++ class is similar to one of these.

a. inline function

b. header file

c. library function

d. structure

e. none of these

2. A ___ is a member function that is automatically called when a class object is ___.

a. destructor, created

b. constructor, created

c. static function, deallocated

d. utility function, declared

e. none of these

3. A class is a(n) ________ that is defined by the programmer.

a. data type

b. function

c. method

d. attribute

e. none of these

4. A class may have this many default constructor(s).

a. only one

b. more than one

c. maximum of two

d. any number of

e. none of these

5. Assume that myCar is an instance of the Car class, and that the Car class has a member function named accelerate. Which of the following is a valid call to the accelerate member function?

a. Car->accelerate( );

b. myCar::accelerate( );

c. myCar.accelerate( );

d. myCar:accelerate( );

6. Examples of access specifiers are the keywords:

a. near and far

b. opened and closed

c. private and public

d. table and row

e. none of these

7. For the following code, which statement is not true?

class Point

{

private:

double y;

double x;

public:

double x;

};

a. x is available to code that is written outside the class.

b. The name of the class is Point.

c. x, y, and z are called members of the class.

d. z is available to code that is written outside the class.

8. If you do not declare an access specification, the default for members of a class is:

a. inline

b. private

c. public

d. global

e. none of these

9. In OOP terminology, an object's member variables are often called its ________, and its member functions are sometimes referred to as its behaviors, or ________.

a. values, morals

b. data, activities

c. attributes, activities

d. attributes, methods

e. none of these

10. In a procedural program, you typically have ________ stored in a collection of variables, and a set of ________ that perform operations on the data.

a. numbers, arguments

b. parameters, arguments

c. strings, operators

d. data, functions

e. none of these

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions