session objectives u2 #s9

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: alma

Post on 23-Feb-2016

36 views

Category:

Documents


0 download

DESCRIPTION

Session Objectives U2 #S9 . 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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Session  Objectives U2 #S9

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: Session  Objectives U2 #S9

A Level Computing#BristolMet

The order of operationsSimilar 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: Session  Objectives U2 #S9

A Level Computing#BristolMet

Key Words (Operators & Operands)

Assignment

RelationalUnary

Boolean Binary

Arithmetic

Page 4: Session  Objectives U2 #S9

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: Session  Objectives U2 #S9

A Level Computing#BristolMet

Applying operators to an algorithm

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