Answer the following questions true (T) or false (F)

1. A file is automatically closed when a program terminates, so there is never a need to close a file.

2. The flush member function copies the file buffer to the file on the file medium (disk, tape, etc).


1. False
Explanation: The statement of the problem is not quite accurate. A program will close a file only if the program terminates normally. It is possible for a file to be left in a corrupt state if the program that opened it terminates abnormally, and does not close the file.
2. True
Explanation: For reasons of efficiency, files on disk are divided into blocks, usually of size between 512 and 4096 bytes. One or more blocks are kept in memory for reading and writing, and are copied to and read from disk (roughly) on an as-needed basis. The flush function copies the buffer to disk before the system would otherwise do so.

Computer Science & Information Technology

You might also like to view...

Write a GUI that will let the user sample borders. Include a menu named Borders that offers three options—beveled border, etched border, and line border—as submenus with the following options:

• Beveled-border submenu options: raised or lowered. • Etched-border submenu options: raised or lowered. • Line-border submenu options: small, medium, or large. Each of these options should be a submenu with three color options: black, red, and blue. Put the borders around a label containing text that describes the border, such as Raised Border, Lowered Etched Border, and so forth. Fix the highlight and shadow colors for the etched-border options to whatever colors you like, and make the small line border 5 pixels wide, the medium one 10 pixels wide, and the large one 20 pixels wide. This Programming Project is fairly easy, especially if done a step at a time. First create the menu hierarchy, then add the lines in the actionPerformed method to set the border style and change the label’s text, depending on the style selected. Note that setActionCommand is used to differentiate selections with the same text (e.g. “Raised” could be either Beveled or Etched).

Computer Science & Information Technology

A ControlTip is similar to a ScreenTip and temporarily displays descriptive text while the mouse pointer is paused over the control

Indicate whether the statement is true or false

Computer Science & Information Technology

It is important to delete unused rows and columns in the sample worksheet data that you do not want included in the chart

Indicate whether the statement is true or false

Computer Science & Information Technology

Which of the following statements about output formatting is false?

A. A control string contains formatting instructions for the data to be output B. The printf function requires a set of zero or more data values C. The minimum code for a conversion specification consists of a conversion code, such as  ‘d' for integer D. There are four optional modifiers that can be used to refine output formatting E. To format data into columns we use the width modifier

Computer Science & Information Technology