Question #1: The name of a file is represented by the ____________ data type; a connection to a file is represented by a ____________ data type.
Question #2: The ____________ class is used for a connection to an input file; the ____________ class is used for a connection to an output file.
Question #3: What should a program do immediately after opening a connection to a file?
Question #4: What should a program do when finished using a connection to a file?
Question #5: Learning about file input and output is made easier because it's so similar to what?
Suppose that filename is a string containing the name
of a file.
Code #1:
Write a statement that opens input as a input connection to
the file named in filename.
Code #2:
Write a statement that opens output as an output connection
to the file named in filename.
Code #3:
Using assert(), write a statement that tests if input was opened correctly.
Code #4:
Write the statement that reads a value from input into
i.
Code #5:
Write a statement that closes the output connection.