Name:     ID: 
 
Email: 

CH3 C++

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

 1. 

A coded algorithm is called an object.
 

 2. 

Programmers typically desk-check a program using the same sample data used to desk-check the algorithm.
 

 3. 

The IPO chart shows the problem’s input, processing, and output items, as well as the algorithm needed to solve the problem.
 

 4. 

In most programming languages, the names of processing items can contain letters, numbers, underscores, punctuation characters or spaces.
 

 5. 

Most C++ programmers use uppercase letters for variable names.
 

 6. 

Items assigned the double data type typically are initialized to the value 1.0.
 

 7. 

All C++ statements must end with a colon.
 

 8. 

The standard output stream is called cout.
 

 9. 

The standard input stream is called stdin.
 

 10. 

A stream manipulator allows the program to manipulate, or manage, the input and output stream characters in some way.
 

 11. 

The statement cout << "Enter current weekly pay: "; prompts the user to enter the current weekly pay.
 

 12. 

You should perform several desk-checks, using different data, to make sure that the program is correct.
 

 13. 

Errors in a program are called hacks.
 

 14. 

You create a syntax error when you enter an instruction that violates the programming language’s syntax.
 

 15. 

Logic errors are easier to find than syntax errors.
 

 16. 

C++ is a superset of C, which means that almost everything available in C also is available in C++.
 

 17. 

Source code files created using the Microsoft Visual C++ 2005 compiler have the filename extension .cpp.
 

 18. 

The file containing the source code is called the source file.
 

 19. 

Machine code is usually called assembly code.
 

 20. 

Many C++ systems, such as Microsoft Visual C++ and Borland C++ Builder, contain both the editor and compiler in one integrated environment, referred to as a GUI.
 

 21. 

A comment is a message to the person reading the program and is referred to as internal documentation.
 

 22. 

The C++ compiler processes the comments when it translates the source code into object code.
 

 23. 

Comments are statements in C++.
 

 24. 

Some functions return a value after completing their assigned task, while others, referred to as null functions, do not.
 

 25. 

A function header marks the beginning of a function.
 

 26. 

A program can contain multiple main() functions.
 

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

 27. 

____ the algorithm refers to the process of translating the algorithm into a language that the computer can understand.
a.
Assembling
c.
Translating
b.
Tracing
d.
Coding
 

 28. 

After completing the coding step, the programmer then ____ the program to make sure that the algorithm was translated correctly.
a.
compiles
c.
desk-checks
b.
evaluates
d.
links
 

 29. 

A programmer evaluates a program by ____ it on the computer.
a.
desk-checking
c.
hand-tracing
b.
running
d.
compiling
 

 30. 

An intermediate value is also referred to as a ____.
a.
processing item
c.
directive
b.
stream
d.
keyword
 

 31. 

If a processing item name contains more than one word, most C++ programmers use ____.
a.
lowercase letters
c.
camel case
b.
uppercase letters
d.
small caps
 

 32. 

A ____ is a word that has a special meaning in a programming language.
a.
keyword
c.
stream
b.
statement
d.
directive
 

 33. 

A ____ is a C++ instruction that causes the computer to perform some action after it is executed, or processed, by the computer.
a.
keyword
c.
processing item
b.
statement
d.
directive
 

 34. 

The ____ of a language is the set of rules that you must follow to use the language.
a.
directives
c.
grammar
b.
mnemonics
d.
syntax
 

 35. 

In C++, ____ are sequences of characters to perform standard input and output operations.
a.
directives
c.
processing items
b.
streams
d.
variables
 

 36. 

____ is called the insertion operator.
a.
<-
c.
<<
b.
->
d.
>>
 

 37. 

____ is called the extraction operator.
a.
<-
c.
<<
b.
->
d.
>>
 

 38. 

The statement ____ tells the computer to get the current weekly pay from the keyboard, and store that amount in the currentPay variable.
a.
cin >> currentPay;
c.
currentPay >> cin;
b.
cin << currentPay;
d.
currentPay << cin;
 

 39. 

____ refers to running the program, along with sample data, on the computer.
a.
Debugging
c.
Linking
b.
Testing
d.
Compiling
 

 40. 

____ refers to the process of locating and removing any errors in a program.
a.
Debugging
c.
Linking
b.
Testing
d.
Compiling
 

 41. 

Most ____ occur as a result of mistyping either a keyword or a variable name, or forgetting to enter a semicolon at the end of a statement.
a.
bugs
c.
syntax errors
b.
warnings
d.
logic errors
 

 42. 

You create a ____ when you enter an instruction that does not give you the expected results.
a.
bug
c.
syntax error
b.
warning
d.
logic error
 

 43. 

____ is an example of a syntax error.
a.
cout << Hello;
b.
cin >> raiseRate;
c.
cout << "New pay: " << newPay << endl;
d.
average = number1 + number2 / 2;
 

 44. 

____ is an example of a logic error.
a.
cout << Hello;
b.
cin >> raiseRate;
c.
cout << "New pay: " << newPay << endl;
d.
average = number1 + number2 / 2;
 

 45. 

When you compile a Microsoft Visual C++ 2005 program, the compiler generates the appropriate object code, saving it automatically in a file whose filename extension is ____.
a.
.obj
c.
.exe
b.
.o
d.
.cpp
 

 46. 

The ____ combines the object file with other machine code necessary for your C++ program to run correctly.
a.
compiler
c.
interpreter
b.
linker
d.
assembler
 

 47. 

The linker produces a(n) ____ file, which is a file that contains all of the machine code necessary to run your C++ program as many times as desired without the need for translating the program again.
a.
source
c.
executable
b.
include
d.
object
 

 48. 

An executable file has an extension of ____ on its filename.
a.
.obj
c.
.exe
b.
.o
d.
.cpp
 

 49. 

You create a comment by typing ____ before the text you want treated as a comment.
a.
<<
c.
\\
b.
>>
d.
//
 

 50. 

A #include ____ provides a convenient way to merge the source code from one file with the source code in another file, without having to retype the code.
a.
directive
c.
variable
b.
stream
d.
function
 

 51. 

using std::cout; is an example of a using ____.
a.
directive
c.
function
b.
statement
d.
processing item
 

 52. 

A ____ is a block of code that performs a task.
a.
statement
c.
function
b.
directive
d.
stream
 



 
         Start Over