Name: 
 

Lesson1



True/False
Indicate whether the statement is true or false.
 

 1. 

Comment statements are frequently used to provide special instructions to the compiler.
 

 2. 

All C++ programs consist of a single function, called main().
 

 3. 

C++ comment statements are frequently used to explain how a portion of a program works to make it easier for someone else to understand the program.
 

 4. 

When a function is defined in a program, the function name must be followed by quotation marks which identify it as a function to the compiler.
 

 5. 

A function definition statement must be terminated by a semicolon.
 

 6. 

In a C++ program, a variable named alpha can also be referenced as Alpha or ALPHA in the same program.
 

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 7. 

Which of the following is a possible reason why comment statements are used in a program?
a.
to explain the purpose and operation of a program
b.
to keep track of programmers who have worked on the program
c.
to document changes and fixes that have been applied to the program.
d.
all of the above
 

 8. 

Which statement below can be included in a C++ program to tell the compiler to insert pre-defined statements into the program as if they were being keyed in by the programmer?
a.
#insert
c.
#include
b.
#incl
d.
#ins
 

 9. 

Every C++ program must have which of the following?
a.
compiler directives
c.
a main() function
b.
comment statements
d.
all of the above
 

 10. 

In the program statement: int main() , what does the word int indicate?
a.
that the function will return an integer value to the operating system
b.
that the function is to be passed an integer value when it is called
c.
that this is an internal function and can only be accessed from this program
d.
none of the above
 

 11. 

What characters are used in C++ source code to indicate the beginning and end of a block of code?
a.
parentheses ( )
c.
curly braces { }
b.
angle brackets < >
d.
square brackets [ ]
 

 12. 

C++ source code files are usually saved using which of the following file extensions?
a.
.c
c.
.cpl
b.
.cpp
d.
.c++
 

Completion
Complete each statement.
 

 13. 

____________________ statements are statements in a program that contain remarks that are ignored by the compiler.
 

 

 14. 

Comment statements in a C++ program begin with a(n) ____________________ character(s).
 

 

 15. 

Files such as iostream.h, which can be included in a program using a compiler directive, are called ____________________ files.
 

 

 16. 

The ____________________ statement is used in a function to pass a value back to the calling function.
 

 

 17. 

Most C++ programming statements must be terminated using a(n) ____________________.
 

 



 
Check Your Work     Start Over