Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Groupings: File File: a group of related records

Similar presentations


Presentation on theme: "Data Groupings: File File: a group of related records"— Presentation transcript:

1 Data Groupings: File File: a group of related records
Customer file, containing all customer records Record: a group of related fields Customer record containing name and address fields Field: group of characters forming a single data item “Smith” Character: single symbol (letter, number, special symbol) “A”, “7”, “$”

2 Data Groupings: Database
Database: collection of related tables, that serve the information needs of the organization Table: a group of related fields Customer record containing name and address fields Field: group of characters forming a single data item “Smith” Character: single symbol (letter, number, special symbol) “A”, “7”, “$”

3 Opening Files Specify file name and path (location)
Issue a file open command If no input file is opened, input may be accepted from the standard input device (e.g., keyboard) You must open both input and output files to be used, including printer output device If no output file is opened, standard output device (e.g., monitor) may be used

4 Reading an Input Record
Reading the first input record is the last housekeeping task (sometimes) Interactive application: Interacts with users via keyboard or mouse input Program pauses when the read command is executed until the user enters data Delimiter: a character designated as a separator between data values Prompt: an output statement that asks the user to enter specific data (usually from keyboard)

5 Reading (Input) a Record

6 Reading an Input Record
Input from a data file:

7 Checking for the End of the File
After reading a file – states no more data to input For an interactive (keyboard input) program, EOF may be determined when: User enters a predetermined sentinel value User selects a screen option using a mouse For input from a file, the input device recognizes EOF EOF may occur on the first read If there is data, each record is processed before the next read occurs and EOF is checked

8 Checking for End of File
No read before checking for EOF

9


Download ppt "Data Groupings: File File: a group of related records"

Similar presentations


Ads by Google