UPDATED ACTUAL Exam Questions and
CORRECT Answers
The devices that feed data and programs into computers are called ____ devices. - CORRECT
ANSWER - input
____ represent information with a sequence of 0s and 1s. - CORRECT ANSWER - Digital
signals
A sequence of eight bits is called a___________. - CORRECT ANSWER - byte
The term GB refers to ___. - CORRECT ANSWER - gigabyte
consists of 65,536 characters. - CORRECT ANSWER - Unicode
A program called a(n) ____ combines the object program with the programs from libraries. -
CORRECT ANSWER - linker
____ is a valid char value. - CORRECT ANSWER - 'A'
An example of a floating point data type is ____. - CORRECT ANSWER - double
The length of the string "computer science" is ____. - CORRECT ANSWER - 16
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, ____. - CORRECT ANSWER - one = 10.5, two =
30.6
,Which of the following is the newline character? - CORRECT ANSWER - \n
Suppose that x is an int variable and y is a double variable and the input is:
10 20.7
Choose the values after the following statement executes: cin >> x >> y;. - CORRECT
ANSWER - x = 10, y = 20.7
Suppose that alpha is an int variable and ch is a char variable and the input is:
17 A
What are the values after the following statements execute?
cin >> alpha;
cin >> ch; - CORRECT ANSWER - alpha = 17, ch = 'A'
Suppose that ch1, ch2, and ch3 are variables of the type char and the input is:
AB
C
Choose the value of ch3 after the following statement executes:
cin >> ch1 >> ch2 >> ch3; - CORRECT ANSWER - 'C'
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; - CORRECT ANSWER - ch = '276', x = '.'
Suppose that alpha, beta, and gamma are int variables and the input is:
100 110 120
200 210 220
300 310 320
,What is the value of gamma after the following statements execute?
cin >> alpha;
cin.ignore(100, '\n');
cin >> beta;
cin.ignore(100,'\n');
cin >> gamma; - CORRECT ANSWER - 300
Suppose that ch1 and ch2 are char variables and the input is:
WXYZ
What is the value of ch2 after the following statements execute?
cin >> ch1;
ch2 = cin.peek();
cin >> ch2; - CORRECT ANSWER -X
Manipulators without parameters are part of the ____ header file. - CORRECT
ANSWER - iostream
Consider the following program segment.
ifstream inFile; //Line 1
int x, y; //Line 2
... //Line 3
inFile >> x >> y; //Line 4
Which of the following statements at Line 3 can be used to open the file progdata.dat and input
data from this file into x and y at Line 4? - CORRECT ANSWER -
inFile.open("progdata.dat");
Suppose that ch1 and ch2 are char variables, alpha is an int variable, and the input is:
A 18
, What are the values after the following statement executes?
cin.get(ch1);
cin.get(ch2);
cin >> alpha; - CORRECT ANSWER - ch1 = 'A', ch2 = ' ', alpha = 18
The expression in an if statement is sometimes called a(n) ____. - CORRECT ANSWER -
decision maker
What is the output of the following C++ code?
int x = 35;
int y = 45;
int z;
if (x > y)
z = x + y;
else
z = y - x;
cout << x << " " << y << " " << z << endl; - CORRECT ANSWER - 35 45 10
When one control statement is located within another, it is said to be ____. - CORRECT
ANSWER - nested
What is the output of the following code?
if (6 > 8)
{