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 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;
(Multiple Choice)
5.0/5
(36)
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.8/5
(41)
In C++, the dot is an operator called the ____________________operator.
(Short Answer)
4.7/5
(45)
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;.
(Short Answer)
4.8/5
(40)
The functions get, ignore, and so on are members of the data type ____________________.
(Short Answer)
4.8/5
(50)
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;
(Multiple Choice)
4.7/5
(43)
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;
(Multiple Choice)
4.9/5
(35)
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
(31)
C++ provides a header file called ____________________, which is used for file I/O.
(Short Answer)
4.8/5
(34)
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
(33)
Suppose that x = 25.67, y = 356.876, and z = 7623.9674. What is the output of the following statements? cout << fixed << showpoint;
Cout << setprecision(2);
Cout << x << ' ' << y << ' ' << z << endl;
(Multiple Choice)
4.9/5
(41)
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?
(Multiple Choice)
4.9/5
(45)
To use the manipulator setprecision, the program must include the header file ____________________.
(Short Answer)
4.7/5
(40)
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.get(ch1);
Cin.putback(ch1);
Cin >> ch2;
(Multiple Choice)
4.8/5
(29)
The function ____________________ returns the next character in the input stream; it does not remove the character from the input stream.
(Short Answer)
4.7/5
(32)
C++ has a special name for the data types istream and ostream. They are called ____________________.
(Short Answer)
4.9/5
(43)
You can use the function getline to read a string containing blanks.
(True/False)
4.8/5
(35)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)