20) An escape sequence starts with a double quote?
a. True
b. False
Answers for C++ Course using "Starting out with C++ : from control structures through objects" by Tony Gaddis. 7/8th ed. I used the Pearson myprogramminglab to complete the homework. Here are my solutions/answers for the exercises/labs so please use the test bank as a GUIDE if you're stuck. Let me know if you find a better solution to a problem or any of the programming challenges. Thanks in advance for your support! Send in missing programming challenges to cplusplus.answers@gmail.com
Chapter 2 Quiz Starting Out With C++ 019
19) cout can only output one item per line?
a. True
b. False
a. True
b. False
Chapter 2 Quiz Starting Out With C++ 018
18) The # symbol marks the beginning of what?
a. a program
b. preprocessor directive
c. comment
d. None of the Above
a. a program
b. preprocessor directive
c. comment
d. None of the Above
Exericse Number
Chapter 02,
Quiz
Chapter 2 Quiz Starting Out With C++ 017
17) Forgetting either an opening { or closing } brace is a common reason a C++ program won't compile
a. True
b. False
a. True
b. False
Chapter 2 Quiz Starting Out With C++ 016
16) What character terminates C++ statements?
a. space
b. semicolon
c. endl
d. none
a. space
b. semicolon
c. endl
d. none
Chapter 2 Quiz Starting Out With C++ 015
15) What function is required by all C++ programs?
a. init
b. processor
c. syntax analyzer
d. main
a. init
b. processor
c. syntax analyzer
d. main
Chapter 2 Quiz Starting Out With C++ 014
14) A function is a group of one or more statements that collectively has a name?
a. True
b. False
a. True
b. False
Chapter 2 Quiz Starting Out With C++ 013
13) C++ uses namespaces to:
a. organize the names of program entities
b. to make entities easier to find
c. speed up compiling
d. make programs easier to read
a. organize the names of program entities
b. to make entities easier to find
c. speed up compiling
d. make programs easier to read
Chapter 2 Quiz Starting Out With C++ 012
12) The preprocessor directive, #include <iostream>, is required for all C++ programs
a. True
b. False
a. True
b. False
Chapter 2 Quiz Starting Out With C++ 011
11) What marks the beginning of a comment in a C++ program?
a. // (The double slash)
b. ' (The single quote'
c. REM
d. COMMENT:
a. // (The double slash)
b. ' (The single quote'
c. REM
d. COMMENT:
Chapter 2 Quiz Starting Out With C++ 010
10) What is the header file that has to be included to allow access to the file?
a. file
b. fileaccess
c. fstream
d. cfile
a. file
b. fileaccess
c. fstream
d. cfile
Chapter 2 Quiz Starting Out With C++ 009
9) You can not store a string in an array of characters.
a. True
b. False
a. True
b. False
Chapter 2 Quiz Starting Out With C++ 008
8) There are more differences between the get function and the >> operator than that get reads the first character typed, even if it is a space, tab, or the [Enter] key.
a. True
b. False
a. True
b. False
Chapter 2 Quiz Starting Out With C++ 007
7) You need to enter the length, width, and height while executing a program. Which cin statement should be used from the following?
a. cin << length, width, height;
b. cin.get(length, width, height);
c. cin >> length >> width >> height;
d. cin >> length, width, height;
a. cin << length, width, height;
b. cin.get(length, width, height);
c. cin >> length >> width >> height;
d. cin >> length, width, height;
Chapter 2 Quiz Starting Out With C++ 006
6) One of the following will make a program to remain inactive until information will be entered at the keyboard and the user presses the Enter key.
a. Output stream
b. cin object
c. cout object
d. Preprocessor
a. Output stream
b. cin object
c. cout object
d. Preprocessor
Chapter 2 Quiz Starting Out With C++ 005
5) When a variable is used to assign a value that will be the result of an expression, it will be changed to:
a. The smallest C++ data type
b. The largest C++ data type
c. The data type of the variable
d. The data type of the expression
a. The smallest C++ data type
b. The largest C++ data type
c. The data type of the variable
d. The data type of the expression
Chapter 2 Quiz Starting Out With C++ 004
4) If you wanted to have a number being displayed in scientific notation, you may use the Fixed manipulator.
a. True
b. False
a. True
b. False
Chapter 2 Quiz Starting Out With C++ 003
3) The setprecision manipulator will be the exact number of digits to show before the decimal point in case of the fixed manipulator.
a. True
b. False
a. True
b. False
Chapter 2 Quiz Starting Out With C++ 002
2) When an object, that is used to enter data by the user, like the cin object, the following ___________must be with it.
a. compiler
b. iostream header file
c. linker
d. >> and << operators
a. compiler
b. iostream header file
c. linker
d. >> and << operators
Chapter 2 Quiz Starting Out With C++ 001
1) You can display in C++ the number 45.211 in a field of 9 spaces with 2 decimal places.
a. True
b. False
a. True
b. False
Chapter 1 Quiz Starting Out With C++ 027
Which statement is true
a. C++ is object-oriented
b. C is object-oriented
c. C can run all C++ programs
d. All of the above
a. C++ is object-oriented
b. C is object-oriented
c. C can run all C++ programs
d. All of the above
Subscribe to:
Posts (Atom)