Exam 3: Inputoutput
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C50 Questions
Exam 3: Inputoutput50 Questions
Exam 4: Control Structures I Selection50 Questions
Exam 5: Control Structures II Repetition50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the String Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records Structs50 Questions
Exam 10: Classes and Data Abstraction49 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Searching, Sorting and the Vector Type50 Questions
Exam 17: Linked Lists50 Questions
Exam 18: Stacks and Queues50 Questions
Select questions type
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;
Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
C
Suppose that ch1, ch2, and ch3 are variables of the type char and the input is: A B
C
What is the value of ch3 after the following statements execute?
cin.get(ch1);
cin.get(ch2);
cin.get(ch3);
Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
B
In the statement cin >> x;, x can be a variable or an expression.
Free
(True/False)
4.7/5
(35)
Correct Answer:
False
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;
(Multiple Choice)
4.7/5
(41)
You can disable the manipulator left by using the stream function ____________________.
(Short Answer)
4.7/5
(34)
Suppose that ch1, ch2, and ch3 are variables of the type char and the input is: A B
C
Choose the value of ch3 after the following statement executes:
Cin >> ch1 >> ch2 >> ch3;
(Multiple Choice)
4.8/5
(42)
In the C++ statement,
cin.get(u);
u must be a variable of type ____________________.
(Short Answer)
4.7/5
(42)
What is the output of the following statements? cout << "123456789012345678901234567890" << endl
Cout << setfill('#') << setw(10) << "Mickey"
<< setfill(' ') << setw(10) << "Donald"
<< setfill('*') << setw(10) << "Goofy" << endl;
(Multiple Choice)
4.9/5
(42)
Manipulators without parameters are part of the ____ header file.
(Multiple Choice)
4.8/5
(36)
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;
(Multiple Choice)
4.8/5
(34)
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;.
(Multiple Choice)
4.8/5
(37)
When reading data into a char variable, after skipping any leading whitespace characters, the extraction operator >> finds and stores only the next character; reading stops after a single character.
(True/False)
5.0/5
(49)
The manipulator ____________________ is used to output the value of an expression in a specific number of columns.
(Short Answer)
5.0/5
(39)
In an output statement, each occurrence of endl advances the cursor to the end of the current line on an output device.
(True/False)
4.8/5
(47)
Suppose that x and y are int variables, ch is a char variable, and the input is: 4 2 A 12
Choose the values of x, y, and ch after the following statement executes:
Cin >> x >> ch >> y;
(Multiple Choice)
5.0/5
(35)
Suppose that x and y are int variables. Which of the following is a valid input statement?
(Multiple Choice)
4.8/5
(44)
The number of input data extracted by cin and >> depends on the number of variables appearing in the cin statement.
(True/False)
4.8/5
(34)
Entering a char value into an int variable causes serious errors, called input failure.
(True/False)
5.0/5
(41)
When you want to process only partial data, you can use the stream function ____ to discard a portion of the input.
(Multiple Choice)
4.8/5
(35)
Suppose that x is an int variable, y is a double variable, z is an int variable, and the input is: 15 76.3 14
Choose the values after the following statement executes:
Cin >> x >> y >> z;
(Multiple Choice)
4.8/5
(40)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)