Nothing going on here, move along…

Posts tagged ‘relational operators’

Systems and programme building bits


An information system must do at least 3 things

Input data into the system

Process data within the system

Output resulting information from the system


A computer program is a solution to a problem

An algorithm is the logical design used to accomplish a specific objective (step by step instructions)

The two most commonly used tools for documenting the program logic (the algorithm) are flowcharts and pseudocode

Syntax is the structure used in coding, typos are a common source of syntax errors

Flow chart

A flow chart has a start, decisions actions and an end point

Input statements

An input statement takes data from a user and stores it in a variable

A variable is a storage location in memory (RAM) that can be accessed and changed by the code

Making decisions

Sample statements

Pay amount = Hours * Rate

Pay amount = 40 * Rate + (Hours – 40) * Rate * 1.5

40 hours are taken off the hours worked (Standard working week), any extra hours are paid at time and a half (Over time)

The IF statement

The most common decision structure is the if statement

A condition is a boolean expression that evaluates to either true or false (yes or no)

Conditions typically involve one of the 6 relational operators

Relational operators

Operation – Description – Expression

=  –  Equal  –  x = 2

<>  –  Not equal  –  y <> 5

>  –  Greater than  –  x > 1

<  –  Less than  –  x < 2

>=  –  Greater than or equal  –  x >= 2

<=  –  Less than or equal  –  x <= 6

Nested IF statement

An IF statement contained within the true or false branch of another IF statement

Compound conditions

A compound condition consists of two conditions within a parentheses joined by a logical operator

eg. a = b  AND c = d, if both are true then it is true

The four most common logical operators are NOT, AND, OR, and XOR  (A=5, B=8)

NOT = Returns the opposite of the condition



Tag Cloud