Exam 3: Input/Output
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 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 (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
Suppose that x and y are int variables.Which of the following is a valid input statement?
(Multiple Choice)
4.9/5
(32)
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.8/5
(29)
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
(43)
The functions get,ignore,and so on are members of the data type ____________________.
(Short Answer)
4.9/5
(34)
In the statement cin >> x;,x can be a variable or an expression.
(True/False)
4.9/5
(46)
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
(34)
You can disable the manipulator left by using the stream function ____________________.
(Short Answer)
4.8/5
(37)
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);
(Multiple Choice)
4.7/5
(33)
What is the output of the following statements?
cout << setfill('*');
Cout << "12345678901234567890" << endl
Cout << setw(5)<< "18" << setw(7)<< "Happy"
<< setw(8)<< "Sleepy" << endl;
(Multiple Choice)
4.9/5
(42)
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;
(Multiple Choice)
4.9/5
(34)
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;
(Multiple Choice)
4.9/5
(31)
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
(32)
The stream function ____________________ lets you put the last character extracted from the input stream by the get function back into the input stream.
(Short Answer)
4.8/5
(36)
C++ has a special name for the data types istream and ostream.They are called ____________________.
(Short Answer)
4.9/5
(46)
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
(37)
On some compilers,the statements cin >> left; and cin >> right; might not work.In this case,you can use the statement ____________________ in place of cin >> left;.
(Short Answer)
4.9/5
(40)
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)
4.8/5
(44)
If input failure occurs in a C++ program,the program terminates immediately and displays an error message.
(True/False)
4.9/5
(35)
Manipulators without parameters are part of the ____ header file.
(Multiple Choice)
4.8/5
(40)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)