Writing to a text file - This uses WRITE
method to write data directly to a file or a
loop to indirectly write data to the file
Reading data from a text file - Each READ statement
reads a record from the file into the program and put
the data into the Array (for a 2D array the data will need
to be split)
Subprograms
Procedures
Do not resturn a value to
the main program.
Function
Return a value to the main program
A subprogram is a self contained
sequence of program instructions
that do a specific task
Make the program code easy to read and write
Easy to identify errors within the code
Make testing easier
Makes the program shorter and can code can be reused many times
Calling Sub programs -
Sub programs are called from
within the main program
SET name TO getname(name)
Local and global Variables
Local - can only be
used within a
subprogram
Global - can be used
within any subprogram
but must be declared at
the start of the program
Validation
This process checks that data that is
inputted is correct for the program and
meet the data needed for the program
to work.
Needed to identify unexpected or
erroneous data without breaking
the program.
Presence check - to ensure
data has been entered
Range check - data should
be entered between a
range e.g. between 10 and
20
Length check - a specified
length of number or
characters have been entered
Testing
This is needed to make sure the program meets the needs of the user.
Test data
Normal data - this is a Valid or in range test
Boundary Data - test under extreme
conditions e.g. at the upper and lower
limits of what to be entered
Erroneous data - data that should be be
excepted within the code
Test plan
show the test data,
expected and actual results
and the type of test
Errors
Syntax
Logical
Run time
Debugging - the process of
identifying errors and
correcting them within the
code.