Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
75 Cards in this Set
- Front
- Back
Main memory is an ordered sequence of items, called ____. pixels registers memory cells addresses |
memory cells |
|
Which of the following expressions correctly determines that x is greater than 10 and less than 20? 10 < x < 20 (10 < x < 20) 10 < x && x < 20 10 < x || x < 20 |
10 < x && x < 20 |
|
The device that stores information permanently (unless the device becomes unusable or you change the information by rewriting it) is called primary storage. |
false |
|
Choose the output of the following C++ statement :cout << "Sunny " << '\n' << "Day " << endl; Sunny \nDay Sunny \nDay endl Sunny Day Sunny \nDay |
Sunny Day |
|
The statement: return 37, y, 2 * 3; returns the value ____. a. 2 b. 6 c. y d. 3 |
b. 6 |
|
C++ programs have always been portable from one compiler to another. |
false |
|
What is the output of the following code? char lastInitial = 'S'; switch (lastInitial) section 2 section 3 section 4 section 5 |
selection 5 |
|
Suppose that x = 55.68, y = 476.859, and z = 23.8216. What is the output of the following statements? cout << fixed << showpoint; cout << setprecision(3); cout << x << ' ' << y << ' ' << setprecision(2) << z << endl; 55.680 476.859 23.82 55.690 476.860 23.82 55.680 476.860 23.82 55.680 476.859 23.821 |
55.680 476.859 23.82 |
|
Suppose that x and y are int variables. Which of the following is a valid input statement? cin >> x >> cin >> y; cin >> x >> y; cin << x << y; cout << x << y; |
cin >> x >> y; |
|
Suppose that x is an int variable, ch is a char variable, and the input is: 276. Choose the values after the following statement executes: cin >> ch >> x; ch = '2', x = 276 ch = '276', x = '.' ch = ' ', x = 276 ch = 'b', x = 76 |
ch = '276', x = '.' |
|
Suppose x is 5 and y is 7. Choose the value of the following expression: (x != 7) && (x <= y) false true 0 null |
true |
|
Which of the following function prototypes is valid? a. funcExp(int x, float v){}; b. int funcExp(x); c. funcExp(void); d. int funcExp(int x, float v); |
d. int funcExp(int x, float v); |
|
Suppose that alpha and beta are int variables. The statement alpha = beta++; is equivalent to the statement(s) ____. alpha = 1 + beta; alpha = alpha + beta; alpha = beta; beta = beta + 1; beta = beta + 1 ;alpha = beta; |
alpha = beta;beta = beta + 1; |
|
Assume you have three int variables: x = 2, y = 6, and z. Choose the value of z in the following expression: z = (y / x > 0) ? x : y;. 2 3 4 6 |
2 |
|
Consider the following statements: string str = "ABCDEFD"; string::size_type position ;After the statement position = str.find('D'); executes, the value of position is ____. 3 4 6 7 |
3 |
|
Which of the following loops does not have an entry condition? EOF-controlled while loop sentinel-controlled while loop do...while loop for loop |
do...while loop |
|
The ____ monitors the overall activity of the computer and provides services. central processing unit operating system arithmetic logic unitcontrol unit |
operating system |
|
____ represent information with a sequence of 0s and 1s. Analog signals Application programs Digital signals System programs |
Digital signals |
|
The digit 0 or 1 is called a binary digit, or ____. bit bytecode Unicode hexcode |
bit |
|
In C++, you can use a(n) ____________________ to instruct a program to mark those memory locations in which data is fixed throughout program execution. |
constant |
|
The standard header file for the abs(x)function is ____. ionput cmath cstdlib cctype |
cmath |
|
The control variable in a flag-controlled while loop is a bool variable. |
true |
|
Suppose that x = 1565.683, y = 85.78, and z = 123.982. What is the output of the following statements? cout << fixed << showpoint; cout << setprecision(3) << x << ' '; cout << setprecision(4) << y << ' ' << setprecision(2) << z << endl; 1565.683 85.8000 123.98 1565.680 85.8000 123.98 1565.683 85.7800 123.98 1565.683 85.780 123.980 |
1565.683 85.7800 123.98 |
|
A program called a(n) ____ translates instructions written in high-level languages into machine code. assembler decoder compiler linker |
compiler |
|
A sequence of eight bits is called a ____. binary digit byte character double |
byte |
|
Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, ____. alpha = 5 alpha = 10 alpha = 50 alpha = 50.0 |
alpha = 50 |
|
The programming language C++ was designed by Bjarne Stroustrup at Bell Laboratories in the early ____. 1960s 1970s 1980s 1990s |
1980s |
|
The data type string has a named constant, ____, associated with it. string::size string::size_type string::pos string::npos |
string::npos |
|
In a C++ program, statements that begin with the symbol # are called ____________________ directives. |
preprocessor |
|
Suppose that x is an int variable, y is a double variable and ch is a char variable and the input is: 15A 73.2 Choose the values after the following statement executes: cin >> x >> ch >> y; x = 15, ch = 'A',y = 73.2 x = 15, ch = 'A',y = 73.0 x = 15, ch = 'a', y = 73.0 This statement results in an error because there is no space between 15 and A. |
x = 15, ch = 'A',y = 73.2 |
|
What is the output of the following C++ code? count = 1; num = 25; while (count < 25) { num = num - 1; count++; } cout << count << " " << num << endl; 24 0 24 1 25 0 25 1 |
25 1 |
|
Suppose str = "xyzw";. After the statement str[2] = 'Y'; The value of str is "____". xyzw xYzw xyYw xzYw |
xyYw |
|
The operators != and == have the same order of precedence. |
true |
|
In C++, a function prototype is the function heading without the body of the function. |
true |
|
Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7; |
true |
|
The ASCII data set consists of ____________________ characters. |
128 |
|
A loop ____________________ is a set of statements that remains true each time the loop body is executed. |
invariant |
|
In the C++ statement, cin.get(u); u must be a variable of type ____________________. |
char |
|
In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >> two; executes, ____. one = 10.5, two = 10.5 one = 10.5, two = 30.6 one = 30.6, two = 30.6 one = 11, two = 31 |
one = 10.5, two = 30.6 |
|
In C++, both ! and != are relational operators. |
false |
|
If the expression in an assert statement evaluates to true, the program terminates. |
false |
|
A variable listed in a header is known as a(n) ____ parameter. a. local b. function c. actual d. formal |
formal |
|
A sequence of 0s and 1s is sometimes referred to as ____________________ code. |
binary |
|
What is the value of x after the following statements execute? int x = 5; int y = 30; do x = x * 2; while (x < y); 5 10 20 40 |
40 |
|
Which of the following statements generates a random number between 0 and 50? srand(time(0));num = rand() % 50; srand(time(10));num = rand()/50; srand(time(0));num = rand()50; srand(time(10));num = rand() % 50; |
srand(time(0));num = rand() % 50; |
|
What is the output of the following code? if (6 > 8) { cout << " ** " << endl ; cout << "****" << endl; } else if (9 == 4) cout << "***" << endl; else cout << "*" << endl; * ** *** **** |
* |
|
Main memory is called ____. |
random access memory |
|
A do...while loop is a(n) ____________________ loop, since the loop condition is evaluated after executing the body of the loop. |
posttest |
|
You can disable the manipulator left by using the stream function ____________________. |
unsetf |
|
The ____________________ statement is typically used for two purposes: • To exit early from a loop. • To skip the remainder of a switch structure. |
break |
|
Which of the following statements is used to simplify the accessing of all globalType namespace members? using globalType; using namespace globalType:all; using namespace globalType::all; using namespace globalType; |
using namespace globalType; |
|
What is the output of the following code? char lastInitial = 'A'; |
section 1 |
|
In the case of the sentinel-controlled while loop, the first item is read before the while loop is entered. |
true |
|
What is the output of the following code? enum courses {ALGEBRA, BASIC, PASCAL, PHILOSOPHY, ANALYSIS}; courses registered; registered = ALGEBRA; cout << registered << endl; ALGEBRA 0 1 "ALGEBRA" |
0 |
|
The string expression strVar.____________________ deletes n characters from strVar starting at position pos. |
erase(pos,n) |
|
To output results correctly, the switch structure must include a(n) ____________________ statement after each cout statement, except the last cout statement. |
break |
|
Which of the following statements creates an anonymous type? enum grades {A, B, C, D, F}; enum grades {}; enum {}; enum {A, B, C, D, F} grades; |
enum {A, B, C, D, F} grades; |
|
C++ has a special name for the data types istream and ostream. They are called ____________________. |
classes |
|
A program that loads an executable program into main memory is called a(n) ____. compiler loader linker assembler |
loader |
|
The value of the expression 6 < 5 || 'g' > 'a' && 7 < 4 is ____________________. |
false |
|
The maximum number of significant digits in values of the double type is 15. |
true |
|
The escape sequence \r moves the insertion point to the beginning of the next line. |
false |
|
Once you write and properly debug a function, you can use it in the program (or different programs) again and again without having to rewrite the same code repeatedly. |
true |
|
If input failure occurs in a C++ program, the program terminates immediately and displays an error message. |
false |
|
Which of the following is the newline character? |
/n |
|
A(n) ____________________ is a sequence of zero or more characters. |
string |
|
The following statement creates an anonymous type: enum {1ST, 2ND, 3RD, 4TH} places; |
false |
|
In an output statement, each occurrence of endl advances the cursor to the end of the current line on an output device. |
false |
|
In object-oriented design, the first step in the problem-solving process is to identify the components called ____________________, which form the basis of the solution, and to determine how they interact with one another. |
objects |
|
____________________ signals represent information with a sequence of 0s and 1s. |
digital |
|
The string expression strVar.____________________ returns the index of the first occurrence at or after pos where str is found in strVar. |
find(str, pos); |
|
The expression static_cast(6.9) + static_cast(7.9) evaluates to ____. 13 14 14.8 15 |
13 |
|
The ____ rules of a programming language tell you which statements are legal, or accepted by the programming language. semantic logical syntax grammatical |
syntax |
|
The following function heading in a C++ program is valid: int funcExp(int u, char v, float g) |
true |
|
On some compilers, the statements cin >> fixed; and cin >> scientific; might not work. In this case, you can use the statement ____________________ in place of cin >> fixed;. |
cin.setf(ios::fixed); |