a level computing#bristolmet session objectives u2#s9 must identify operators and operands should...

5
A Level Computing#BristolMet Session Objectives U2#S9 MUST identify operators and operands SHOULD describe different types of operator COULD Create an algorithm using suitable arithmetic operators

Upload: kenneth-booth

Post on 12-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Level Computing#BristolMet Session Objectives U2#S9 MUST identify operators and operands SHOULD describe different types of operator COULD Create an

A Level Computing#BristolMet

Session Objectives U2#S9

MUST identify operators and operands

SHOULD describe different types of operator

COULD Create an algorithm using suitable arithmetic operators

Page 2: A Level Computing#BristolMet Session Objectives U2#S9 MUST identify operators and operands SHOULD describe different types of operator COULD Create an

A Level Computing#BristolMet

The order of operations

Similar to BODMAS/BIDMAS in Maths, computing has its own order of precedence.

TASK:

Copy down the operator precedence table, with examples on p.103

And then test with simple programs in Python

i.e x = 3 + 5 * 6

and x = (3 + 5) * 6

NB: It is good practice to use brackets even when the order of precedence is correct as it is easier to understand.,

Page 3: A Level Computing#BristolMet Session Objectives U2#S9 MUST identify operators and operands SHOULD describe different types of operator COULD Create an

A Level Computing#BristolMet

Key Words (Operators & Operands)

Assignment

RelationalUnary

Boolean Binary

Arithmetic

Page 4: A Level Computing#BristolMet Session Objectives U2#S9 MUST identify operators and operands SHOULD describe different types of operator COULD Create an

A Level Computing#BristolMet

Operators and Operands

Numeric data which is to be manipulated in an arithmetic operation is called an operand. The action or manipulation to be done is called the operator

i.e x = a + b (a and b are the operands and + is the operator)

This example has 2 operands and these are called binary operators.

Some have only one operand (either before or after) these are called unary operators.

e.g –m is the unary operator for negation or negative m

Page 5: A Level Computing#BristolMet Session Objectives U2#S9 MUST identify operators and operands SHOULD describe different types of operator COULD Create an

A Level Computing#BristolMet

Applying operators to an algorithm

Attempt to create algorithms to solve Task 2 of the programming project.