Exam 3: Inputoutput

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

Suppose that outFile is an ofstream variable and output is to be stored in the file outputData.out. Which of the following statements opens the file outputData.out and associates outFile to the output file?

Free
(Multiple Choice)
4.8/5
(44)
Correct Answer:
Verified

B

You can use the function getline to read a string containing blanks.

Free
(True/False)
4.7/5
(41)
Correct Answer:
Verified

True

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;

Free
(True/False)
4.9/5
(45)
Correct Answer:
Verified

False

Suppose that x = 55.68, y = 476.859, and z = 23.8216. What is the output of the following statements? Suppose that x = 55.68, y = 476.859, and z = 23.8216. What is the output of the following statements?

(Multiple Choice)
4.9/5
(46)

The extraction operator >> skips only all leading blanks when searching for the next data in the input stream.

(True/False)
4.9/5
(37)

Suppose that ch1 and ch2 are char variables and the input is: WXYZ What is the value of ch2 after the following statements execute? Suppose that ch1 and ch2 are char variables and the input is: WXYZ What is the value of ch2 after the following statements execute?

(Multiple Choice)
4.8/5
(36)

Suppose that x is an int variable, y is a double variable, and ch is a char variable. The input is: ​ 15A 73.2 ​ Choose the values after the following statement executes: ​ Cin >> x >> ch >> y; ​

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.9/5
(39)

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)

The number of input data extracted by cin and >> depends on the number of variables appearing in the cin statement.

(True/False)
5.0/5
(35)

Suppose that x and y are int variables. Which of the following is a valid input statement?

(Multiple Choice)
4.7/5
(31)

Suppose that ch1, ch2, and ch3 are variables of the type char. 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.8/5
(34)

Suppose that alpha is an int variable and ch is a char variable. The input is: ​ 17 A ​ What are the values after the following statements execute? ​ ​ Suppose that alpha is an int variable and ch is a char variable. The input is: ​ 17 A ​ What are the values after the following statements execute? ​ ​

(Multiple Choice)
4.8/5
(40)

Manipulators without parameters are part of the ____ header file.

(Multiple Choice)
4.9/5
(30)

What is the output of the following statements? What is the output of the following statements?

(Multiple Choice)
4.7/5
(32)

If input failure occurs in a C++ program, the program terminates immediately and displays an error message.

(True/False)
4.8/5
(31)

C++ provides a header file called ____________________, which is used for file I/O.

(Short Answer)
4.9/5
(27)

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

(Short Answer)
4.8/5
(37)

C++ has a special name for the data types istream and ostream. They are called ____________________.

(Short Answer)
4.9/5
(33)

Entering a char value into an int variable causes serious errors, called input failure.

(True/False)
4.9/5
(40)
Showing 1 - 20 of 40
close modal

Filters

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