Pascal

Design tools
Flowcharts, Data flow diagrams, HIPO, Algorithm, Pseudocodes, Decision tables / Trees and Entity relationship diagrams.

Development / Coding
Is the process of writing the program statements using a given programming language e. g pascal. Each programming language has rules that must be followed called SYNTAX

About Pascal
Pascal is a high level programming language and its statements typed in a text editor, this is called the source code. The statements are not directly understood by the computer and therefore are translated to machine language by use of a special program known as the compiler (this becomes the object code when displayed back to the programmer). Example of pascal compilers: Turbo pascal from Borland. Quick pascal from Microsoft.

Program development environment / Software resources
This is what you require in order to write the program (depending on the program).

Compiler
Interprets instructions from high level language to machine language. It interprets the whole code at once.

Text editor
Allows the programmer to type program statements and hold them as ASCII text.

Debugger
It assists in the process of error correction. A bug is unwanted code or error. It is a program that allows the programmer to detect / get/ identify errors and to do the correction.

Linker
Is a program that combines the existing files / inbuilt libraries (what is necessary to make the object code work) with the program for it to execute properly.

Testing
Is the process of trying to find out if the program is working properly and producing the expected results / output.

Dry running
Is the process of going through the code on the paper / screen literally with your eyes to check for errors based on the rules of the language. It involves reading and identifying errors on paper before keying the code in.

Testing using a compiler
After keying in the program, the compiler checks for the syntax / rules of the language.

Test data
Test data should include the following: Normal values, exceptional values, and extreme values.
 * 1) Use of dummy data(bad / wrong data)
 * 2) Use of Actual data

Header:
This is the identity of the program.

Syntax: Program programname (input,output); Program: is a reserved word supported by the pascal language compiler. Programname is given by the programmer and should follow the rules of naming identifiers. First latter must be an alphabet. No special characters / symbols should be used apart from the underscore. No spaces allowed in name. Maximum of 63 characters. Input, Output indicates that the program can receive input from the user and output results to the user or screen. Example: Program calculate (input, output); Program calculate; Program calculate(output, input); The header is optional in Turbo pascal but compulsory in some of the other variants of pascal.

Block:
The block is divided into two parts; declarations part and statement (body) part. Declaration part: Pascal is a strongly typed language, meaning that a;ll the variables used in the program must be declared before it is used. Label: Labels may be alphanumeric or numeric. para1, para2; 100, 200; Constant:

It a named memory location whose value does not change during program execution / value of a quantity which does not change when a program executes. e.g pie. const pie = 3.1428; By making this definition, wherever pie occurs in the program is assigned the value 3.14. If you assign pie another value in the program will result to an error.

Type definition: This section allows the programmers to define their own datatypes. e.g arrays and records type marks = Array[1..20, 1..10] of integer; studrec= record fields end; Variable definition: It is a named memory location whose value may change during program execution. It is a value of a quantity that varies program execution.

Pascal supports the following variable types: Real, char, integer, Boolean see Pascal Data Types e.g. var area, volume: real; radius, height: integer; Procedures and functions:

These have all the properties of a program only that they can only be executed from the main program, though it is a self contained program. procedure hallo: begin writeln('Hallo to you!'); end;{The end must have a semicolon after it}

function area(base, height: real) : real; begin area := 0.5 * base * height; end;{the end must have a semi colon} Body: These is where the pascal statements are written. It is enclosed within begin and end. statements. The last end. must have a period(full stop) after it. begin x:= 45; writeln(x); end.


 * 1) Pascal Data Types
 * 2) Pascal Operators & Operator Precedence
 * 3) Pascal Input/Output
 * 4) Pascal Control Structures
 * 5) Pascal Arrays
 * 6) Pascal Functions and Procedures
 * 7) Pascal Records
 * 8) Pascal Files
 * 9) Pascal Sets and Pointers
 * 10) Pascal Classes and Objects
 * 11) Pascal Sample Codes
 * 12) Free Pascal Projects