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 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)
4.7/5
(32)
The following statements will result in input failure if the input values are not on a separate line.(Assume that x and y are int variables.)
cin >> x;
cin >> y;
(True/False)
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
(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
(47)
Entering a char value into an int variable causes serious errors,called input failure.
(True/False)
4.8/5
(33)
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
(35)
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
(34)
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
(39)
C++ comes with a wealth of functions,called ____________________ functions,that are written by other programmers.
(Short Answer)
4.8/5
(37)
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
(29)
Showing 41 - 50 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)