90 likes | 237 Views
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
E N D
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.,
Key Words (Operators & Operands) Binary Boolean Assignment Arithmetic Unary Relational
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 unaryoperators. e.g–m is the unary operator for negation or negative m
Applying operators to an algorithm Attempt to create algorithms to solve Task 2 of the programming project.