Sei sulla pagina 1di 1

If statements

PROGRAMMING Integer
Real DATA
Char TYPES IF statements contain blocks of code to be
WITH PASCAL Boolean executed only if a condition or parameters
inserted amount to true. It takes the general form
BY: JOSHUA GOPAUL
Variables and contstants of: IF (//Condition) then {//Run Code} Else-
if(//Other wise,run more code} Else{//Nothing is
true run code here}

Topics Covered A constant remains unchanged during


program execution while a variable can Arrays
be modified at any point. Variables can
be either local or global.
Data Types An array is a variable type, it can store vasts of amount
of data related to each other such that the data type
must be the same. It takes the general form of
Logical operators
Array[1,2,4,5,6,7...], To access and element simply call
Variables and Contants the array in the form: Array[index], where index is the
Logical Operators include relational operators, location, it starts counting from 0. Therefore 0=1st
Arithmetic operators and Boolean operators. All element.
Logical Operators
of which perform 1 thing in common, to check
whether a statement is true or false Labels

IF statements Loops
Labels can be used to jump to specific section
of a code and start executing from there again.
Loops A loop statement allows for the repetition of a It takes the form of Goto LabelName. Where
block of code during program execution. Loop labelName is a label located anywhere in the
types in pascal include : While-Do-Loop,for-do program.
loop, repeat-until loo[. Loops can also be nested in
Functions
each other, ie. A loop within a loop Records

Functions
Arrays A record is a variable that allows storage of
different data types but the information is
related. Eg. A book has: A Title(String),
A function is a sub-routine in a program that can be PageNum(Integer) ect. A record can store all
Labels
called on to run code over and over again as many this in one place. Records are fixed in number
times as necessary. Functions often take on and sequence.
parameters which makes them dynamic.
Records END

Potrebbero piacerti anche