Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2.1 Files
In computer operations, a file is collection of related data that is created as a single unit on a
peripheral device. A file can be of following two types:
1. Master file
2. Transaction file
Transaction file: A transaction file is a file in which the current data are stored for subsequent
processing usually in combination with a master file.
Transaction data may be collected automatically or may initially be recorded on source documents
and later converted to a machine readable format. This leads to the creation on transaction records
that are stored in transaction file.
A transaction file contains the records that are used to update the records of the master file. It is very
important that the transaction file should contain records with the fields and their names in the same
order and size and type as that of the master file.
Sequential file: Sequential file is one in which the records are stored some sequence or order.
For example: A student’s file may be kept in the order of ascending roll number.
Advantages of Sequential File Organization:
c.When the activity rate is high, simplicity of the accessing method makes processing efficient.
a. Updating requires that all transaction records to be first sorted in the key record sequence.
b.A new master file, physically separate and exclusive is always created as a result of sequential
updating.
c.Information on the file is not always current. Addition and deletion on records are not simple tasks
Relative file: Relative files are other types of disk files that also permit random access. Relative file
does not use an index to access records randomly. Rather the key field of each record is used to
calculate the record’s relative location in the file stored on the disk.. With the relative files the key
field is converted to an actual address.
Index file: An indexed file is one that has an index for looking up locations of records on a disk. This
index enables the user to access a disk file randomly.Index files are very useful for processing where
a user communicates directly with the computer using a key field he or she is entering( not
necessarily enter in sequence).Once the address of the disk record is obtained from an index the
access mechanism can move directly to that address on the disk where that record is located. Hence
the method of accessing record will be faster.
There are several methods of processing data depending on the type of data and the time available for
the processing and getting results:
a. Batch processing: Batch processing is one of the oldest methods of running programs that is still
being employed by many data processing centres for processing their jobs.
It is based on the idea of automatic job-to-job transition facility prepared by almost al operating
systems.
Batch processing is also known as serial, sequential, off line or stacked job processing.
b. On-line processing: Online processing permits transaction data to be fed directly into secondary
on-line storage devices.
Here the access to, retrieval of, any record is quick and direct.
Online processing systems feature random and rapid input of transactions and immediate and direct
access record contents as and when needed.
c. Real-time processing: Real time means immediate response from the computer. A system in
which a transaction accesses and updates a file quickly enough to affect the original decision making
is called a real-time system.
Here files are updated each minute, and enquiries are answered by split-second access to up-to-the-
minute records.
Questions:
Q1. Explain types of files.
Q2. Explain modes of processing.
CHAPTER 3: PRINCIPLES AND TECHNIQUES OF
PROGRAMMING
Instructions: Instructions are the directions that the computer will follow and a particular
sequence of instructions is called the program‟s logic.
Buffers: Buffers are reserved spaces in the computer memory that will accept and hold the data
while it is being processed.
Constants: Constants are fixed values within the program that are used for comparing.
b. Portability: Write the code using high level language so that it is easy to transfer the program to
other machines as well.
If possible, avoid non-standard features an also use the standard library runtime routines rather than
writing your own and thus save time.
c. Maintainability: While writing the program think about how you might want to change or extend
it in future.
For example, put data structure definitions in header files where changes will automatically broadcast
to all source files that include the header file.
Guidelines for Good Programming:
a) File handling is the part of the operating system that manages the physical storage and retrieval of
data on a floppy disk or other storage device.
b) File handling refers to the software that allows for the creation, storage, retrieval and manipulation
of files interactively at a terminal or personal computer.
c) File handling is the management of all files or data and information within an organization and
includes data administration, the standards for defining data and the way in which people perceive
and use it in their day-to- day tasks.
d) File handling is a function within an organization that manages the file.
The American National Standards Institute (ANSI) has standardized flowchart symbols
The symbols are:
1. Processing: A processing symbol is used in flowchart to represent arithmetic and data movement
instructions. Rectangle
2. Flow lines: Flow lines with arrowheads are used to indicate the flow of operation, that is, the exact
sequence in which the instructions are to be executed. Straight and horizontal Lines
3. Decision: The decision symbol is used in a flowchart to indicate a point at which a decision has to
be made and a branch to one of two or more alternative points is possible. Diamond
4. Connector: Whenever a flowchart becomes too complex that the number and direction of flow
lines is confusing or it spreads over more than one page, it is useful to utilize the connector symbol as
a substitute for flow lines. This symbol represents an entry from, or an exit to another part of the
flowchart. Small circle
6. Input/Output - rhombus
Efficient Coding
Systematic Debugging
Systematic Testing
3.5.3 Limitations of Flow charts
Non- Standardization
3.6 Psuedocode
Pseudocode is program analysis tool that is used for planning program logic. It is an imitation of
actual computer instructions and these are written in ordinary natural language such as English.
Examples of Pseudocode:
Pseudocode:
BEGIN
Turn Mincer On
Mince Dosa Masala
Turn Mincer Off
END
Operation on File:
Procedural programming is based on the procedures. In the procedural programming, all the
returning sequences if statements placed in main program. A procedure call is used to invoke the
procedure. After the execution of statements, flow of control return after the position where the call
was made.
Top-Down Design is the technique of breaking problem down into the major tasks to be performed.
Each of these tasks is the further broken down into separate subtasks, and so on till each subtask is
sufficiently simple to be written as a self contained module or procedure. The program then consists
of a series of simple modules.
Questions:
Q1. What are the characteristics of good programming?
Q2. What is a flow chart? Explain its symbols?
Q3. What is Pseudocode?
Q4. Explain types of Programming.