You are on page 1of 3

discuss the relative merits of iterative and recursive solutions to the same problem

Recursive elegant. Iterative faster, easier to understand and write


discuss the importance of good interface design
explain the benefits of designing a solution to a problem by splitting it up into smaller problems
easier to understand the problem
when dealing with smaller problems
simpler to debug
small parts at a time
easier to maintain
changing small sections
can re-use his modules
in this and future work

each can work on individual modules
modules can be written in parallel
easier to understand // reduce complexity
to enable modular testing/maintenance/debugging
define and correctly use the following terms as they apply to procedural programming:
statement, subroutine, procedure, function, parameter, loop
A statement in a programming language is simply an instruction that can be executed. Each statement
can be simple or complex.
A subroutine is a self-contained block of code that has an identifier name. A subroutine can be either
a procedure or a function.
A procedure is a block of code that can receive values from another program and can return none, one
or many values back to that program. If the algorithm design has been produced using a top-down
approach, then the different steps or stages in the design might each be coded as a procedure. A
function is given an identifier name and can also receive values from another program but returns
only one value to the calling program. Much more detail about subroutines, procedures and functions
are discussed in later sections.
identify the three basic programming constructs used to control the flow of execution:
sequence, selection and iteration
estimate the size of a file from its structure and the number of records
store, retrieve and search for data in files
define, understand and use the following terms correctly as they apply to programming:
variable, constant, identifier, reserved word/keyword
a named location in the computers memory that can be used to store data. The name is then used to
refer to the address of that data. Can be changed
name given to a particular construct like a subroutine etc.

describe types of errors in programs (syntax, logic and run-time errors) and understand how and
when these may be detected
describe the use of a range of debugging tools and facilities available in program development
environments including translator diagnostics, breakpoints, stepping, and variable check/watch
The line that names and describes the function (line 33) is called the function header or the function
interface



When you compile code one of two things will happen.
1. You will get a build succeeded message
2. You will get a list of nasty syntax errors
This report is known as translator diagnostics. In the first situation it will tell you if
the build succeeded. You will not be able to execute the code unless the build
succeeded. The second one will help you find and remove the error.
The error report which is generated by the
translator is very structured. It is designed
to allow the programmer to easily find and
solve the problem. In the example to the
right (click to see the full size image) you
can see the main elements of the error
report -

Example Diagnostics
1. Build failed message
2. Type of the error
3. Line number of error
4. Source file of error
This information should be enough to find and solve the problem. As sometimes there
may be more than one source code file in the system you will need to know which file
has the problem. Secondally you need to know where in the file the problem is.
Finally you will need to know the type of the error. Commonly in IDE's if you click
on the error it will take you striaght there.
Although the error reports are fairly accurate (they have improved a lot over the
years!) they may not always get it right. The programmer must treat the error reports
as suggestions to what the problem is not actual truth. Read the section on spotting
errors to see what the common errors are.

You might also like