Issuu on Google+

Full file at

2 Welcome Application Introduction to C++ Programming (Test-Item File)

Full file at

Full file at

Test-Item File Tutorial 2 Compiling and Running the Template Welcome Application


2.1 In Visual Studio .NET, every application can have

solution(s) and can have

a) at most one, at most one c) at most one, several e) None of the above.


b) several, at most one d) several, several

Answer: c.

is a standard extension for an executable file.


a) .exe c) .obj e) All of the above.

b) .exec d) .cpp

Answer: a.


Introduction to C++ Code

2.3 Comments that begin with // can be

a) end-of-line comments c) placed inside a string e) None of the above.

. b) full-line comments d) either a or b.

Answer: d. 2.4 The

file must be included for any application that outputs data to the screen or inputs data from the keyboard using C++-style

stream input/output. a) <stream> c) <iostream> e) None of the above.

b) <cppio> d) <streamio>

Answer: c. 2.5 The space whitespace character is always ignored by the compiler in C++ except when placed

a) in a full-line comment c) between statements e) None of the above.

b) in a string d) in an end-of-line comment

Answer: b. 2.6

must end the body of every function. a) A semicolon (;) c) A return statement e) A comment

b) A right brace (}) d) Keyword end


Full file at

Answer: b. 2.7 A

operator has two operands.

a) comment c) binary e) None of the above.

b) twinary d) unary

Full file at

Answer: c. 2.8 Comments


a) help improve application readability c) are ignored by the compiler

b) are preceded by two forward slashes d) can be placed at the end of a line containing a statement

e) All of the above. Answer: e. 2.9 C++ statements end when (the)

is (are) reached.

a) forward-slash (/) character c) two forward-slash (//) characters e) None of the above.

b) semicolon (;) character d) asterisk (*)

Answer: b. 2.10 A portion of code that performs a specific task and may return a value is known as a(n)

a) variable c) operand e) None of the above.

b) function d) identifier

Answer: b.


Constructing the Welcome Application

2.11 The

character terminates a statement.

a) . c) newline e) left brace ({)

b) : d) ;

Answer: d. 2.12 When \\ is inserted into a string being displayed,

a) the string is terminated c) the compiler treats the remainder of the line as a comment d) a runtime error occurs e) All of the above.

. b) a backslash is displayed

Answer: b.


Compilation Errors

2.13 Logic errors


a) prevent an application from compiling b) can cause your program to produce erroneous results when run c) occur when code statements violate d) Both a and c. the grammatical rules of the programming language


Full file at

e) None of the above. Answer: b. 2.14 Which of the following statements contains a syntax error?

a) using namespace std c) cout << Welcome to C++!; e) Both a and c. Answer: e.

b) return 0; d) #include <iostream>

Test bank simply c 1st edition deitel