1. In a C++ program, two slash marks ( // ) indicate:
A. The end of a statement
B. The beginning of a comment
C. The end of the program
D. The beginning of a block of code
E. None of the above


2. A statement that starts with a # is called a:
A. Comment
B. Function
C. Preprocessor directive
D. Key Word
E. None of the above.


3. True/False: C++ is a case-sensitive language
A. True
B. False


4. For every opening brace in a C++ program, there must be a:
A. String constant
B. Function
C. Variable
D. Closing brace
E. None of the above


5. The ______ is/are used to display information on the computer's screen.
A. Opening and closing braces
B. Opening and closing quotation marks
C. cout object
D. Backslash
E. None of the above


6. The _____ causes the contents of another file to be inserted into a program.
A. Backslash
B. Pound sign
C. Semicolon
D. #include directive
E. None of the above


7. True/False: Variables represent storage locations in the computer's memory.
A. True
B. False


8. __________ are data items whose values do not change while the program is running.
A. Constants
B. Variables
C. Comments
D. Integers
E. None of the above


9. True/False: A preprocessor directive does not require a semicolon at the end.
A. True
B. False


10. You must have a ___________ for every variable you intend to use in a program.
A. Purpose
B. Declaration
C. Comment
D. Constant
E. None of the above


11. True/False: In C++ you are required to give variables names that indicate what the variables are used for.
A. True
B. False


12. Of the following, which is a valid C++ identifier?
A. June1997
B. _employee_number
C. ___department
D. myExtraLongVariableName
E. All of the above are valid identifiers.


13. The numeric data types in C++ are broken into two categories:
A. numbers and characters
B. singles and doubles
C. integer and floating point
D. real and unreal
E. None of the above


14. True/False: A variable called "average" should be declared as an integer data type because it will probably hold data that contains decimal places.
A. True
B. False


15. Besides decimal, two other number systems you might encounter in C++ programs are:
A. Octal and Fractal
B. Hexadecimal and Octal
C. Unary and Quaternary
D. Base 7 and Base 9
E. None of the above


16. A character constant is enclosed in ________ quotation marks, whereas a string constant is enclosed in ________ quotation marks.
A. double, single
B. triple, double
C. open, closed
D. single, double
E. None of the above


17. C++ automatically places the ___________ at the end of string constants.
A. Semicolon
B. Quotation marks
C. Null terminator
D. Newline escape sequence
E. None of the above


18. When a variable is declared, it has ___________ scope.
A. No
B. Global
C. Local
D. Undetermined
E. None of the above


19. What is the modulus operator?

Answer:


20. True/False: Too many comments in a program can cause the compiler to become overloaded and potentially crash.
A. True
B. False



This is the end of the test. When you have completed all the questions and reviewed your answers, press the button below to grade the test. (this feature has been disabled).