click below
click below
Normal Size Small Size show me how
chap 2
comp sci
| Question | Answer |
|---|---|
| How would you consolidate the following declaration statements into one statement? int x = 7; int y = 16; int z = 28; | int x = 7, y = 16, z = 28; |
| ________ represent storage locations in the computer's memory | variables |
| What will the following code display? int number = 7; cout << "The number is " << "number" << endl; | The number is number |
| A variable whose value can be either true or false is of this data type. | bool |
| What will the value of x be after the following statements execute? int x; x = 18.0 / 4; | 4 |
| If you use a C++ key word as an identifier, your program will: | not compile |
| Every complete C++ program must have a __________. | Function named main |
| In the C++ instruction, cookies = number % children; given the following declaration statement: int number = 38, children = 4, cookies; what is the value of cookies after the execution of the statement? | 2 |
| Of the following, which is a valid C++ identifier? | all of the above |
| What will the value of x be after the following statements execute? int x; x = 18 % 4; | 2 |
| Escape sequences are always stored internally as a single character. | true |
| These are data items whose values do not change while the program is running. | literals |
| Which of the following defines a double-precision floating point variable named payCheck? | double payCheck; |
| A character literal is enclosed in ________ quotation marks, whereas a string literal is enclosed in ________ quotation marks. | single, double |
| cout << "Four\n" << "score\n"; cout << "and" << "\nseven"; cout << "\nyears" << " ago" << endl; | Four score and seven years ago |
| A variable's __________ is the part of the program that has access to the variable. | scope |
| _______ must be included in any program that uses the cout object | The header file iostream |
| Assume that a program has the following variable definition: char letter; Which of the following statements correctly assigns the character Z to the variable? | letter = 'Z'; |
| For every opening brace in a C++ program, there must be a: | a closing brace |
| This function in C++ allows you to identify how many bytes of storage on your computer system an integer data value requires. | sizeof |