C++ Chapter 3

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

setfill

The manipulator _ is used to fill the unused columns on an output device with a character other than a space.

fixed

The manipulator _ outputs floating-point numbers in the fixed decimal format.

showpoint

The manipulator __ outputs floating-point numbers with a decimal point and trailing zeros

setw

The manipulator ____________________ is used to output the value of an expression in a specific number of columns. The output is not truncated and the output of the expression expands to the required number of columns.

inFile.close();, outFile.close();

To close a file as indicated by the ifstream variable inFile, you use the statement _. To close a file as indicated by the ofstream variable outFile, you use the statement _.

iostream

To use cin and cout, the program must include the header file ________.

iostream

To use stream functions get, ignore, putback, peek, clear, and unsetf for standard I/O, the program must include the header file _

iomanip

To use the manipulators setprecision, setw, and setfill, the program must include the header file ______.

fail state

the state an input stream enters after input failure in which all further I/O statements using that stream are ignored

output stream

A stream from a computer to a destination:

setprecision

The manipulator _ formats the output of floating-point numbers to a specified number of decimal places.

fstream

A header file that contains all the declarations necessary for file operations. Contains the definitions of ifstream and ofstream.

peek

The function ____________________ returns the next character in the input stream; it does not remove the character from the input stream.

stream

A _ in C++ is an infinite sequence of characters from a soure to a destination.

input stream

A _ is a stream from a source to a computer

ifstream, ofstream

For file I/O, you must use the statement #include <fstream> to include the header file fstream in the program. You must also do the following: declare variables of type _ for file input and of type _ for file output and use open statements to open input and output files. You can use <<, >>, get, ignore, peek, putback, or clear with file stream variables.

right-justified, left

If the number of columns specified in the setw manipulator exceeds the number of columns required by the next expression, the output is _. To left-justify the output, you use the manipulator _

clear

Once an input failure has occurred, you use the function clear to restore the input stream to a working state.

cin

Stands for common input, an input stream object, typically initialized to the standard input device, which is the keyboard

cout

Stands for common output, an output stream object, typically initialized to the standard output device, which is the screen.

get

THe function _ is used to read data on a character-by-character basis and does not skip any whitespace characters.

ignore

The function _ is used to skip data in a line.

putback

The function _ puts the last character retrieved by the function "get" back into the input stream.

>>

When inputting data into a variable, the operator _ skips all leading whitespace characters.

>>

When the binary operator _ is used with an input stream object, such as cin, it is called the stream extraction operator. The left side operand of _ must be an input stream variable, such as cin; the right-side operand must be a variable.

<<

When the binary operator _ is used with an output stream object, such as cout, it is called the stream insertion operator. The left-side operand of _ must be an output stream variable, such as cout; the right-side operand of _ must be an expression or a manipulator.


Set pelajaran terkait

BI 231 - Chapter 12 - Questions - FINAL

View Set

Mortuary Law CH-14 FTC Funeral Rule

View Set

Chapter 8: The Ancient Egyptian Pharaohs

View Set

Negotiable Instruments - Form and Content

View Set