Exam 3: Inputoutput

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)
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)

____ is a parameterized stream manipulator.

(Multiple Choice)
4.9/5
(38)

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)

In C++, the dot is an operator called the ____ operator.

(Multiple Choice)
4.8/5
(31)

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)

cin is called a(n) ____________________ object.

(Short Answer)
5.0/5
(30)

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

Filters

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