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

1. A using directive that appears inside a set of braces applies Select one: a.

ID: 3682364 • Letter: 1

Question

1.

A using directive that appears inside a set of braces applies

Select one:

a. only to that block.

b. from that point to the end of the file.

c. everywhere.

d. only if the namespace is std.

2.

Connecting the application and implementation files together to form an executable file is called

Select one:

a. compiling.

b. assembling.

c. linking.

d. debugging

3.

The identifier used in the #ifndef directive should be

Select one:

a. the name of the class in upper case letters.

b. your name in upper case letters.

c. the file name in uppercase letters (with an _ instead of a ).

d. whatever you want it to be.

4.

In order to make a user-defined ADT available that is defined in the file myfile.h, you would

Select one:

a. #include <myfile.h>

b. #include myfile.h

c. #include <myfile>

d. #include "myfile.h"

5.

In order to hide functions that are defined in the implementation file, they should be part of the ________ namespace.

Select one:

a. global

b. std

c. class

d. unnamed

6.

Which file name will end in a .cpp?

Select one:

a. implementation file

b. application file

c. all input files

d. interface file

e. implementation file and application file

7.

If you have a class defined in separate files, and change the way a class is defined, which files need to be re-compiled?

Select one:

a. the interface

b. the application

c. the implementation

d. all files

e. the application and the implementation

8.

What is the difference between an ADT and a class in C++?

Select one:

a. In an ADT, the user does not have access to the implementation details.

b. In an ADT, the user can change the implementation details.

c. There is no difference.

d. A class must always be in a separate file.

9.

If you have a class defined in separate files, and change the main program, which files need to be re-compiled?

Select one:

a. the interface

b. the application

c. the implementation

d. all files

e. the application and the implementation

10.

We use the #ifndef, #define, and #endif

Select one:

a. to prevent multiple definitions of a class.

b. when we use separate files.

c. whenever we use a class.

d. None of these.

e. to prevent multiple definitions of a class and when we use separate files

11.

Which file name will end in a .h?

Select one:

a. implementation

b. application

c. all input files

d. interface file

e. implementation and application

Explanation / Answer

1. a. only to that block.
2. c. linking.
3.   c. the file name in uppercase letters (with an _ instead of a ).
4. d. #include "myfile.h"
5. c. class
6. e. implementation file and application file
7. c. the implementation
8. a. In an ADT, the user does not have access to the implementation details.
9. c. the implementation
10. e. to prevent multiple definitions of a class and when we use separate files
11. d. interface file