Exam 3: Input/Output

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

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)

cin is called a(n)____________________ object.

(Short Answer)
4.8/5
(45)

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

Filters

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