Exam 3: Input/Output

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)