Arithmetic operators + - * / ^ (7c)

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Arithmetic operators + - * / ^ (7c)

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which symbol raises a number to a power in pseudocode?
A ^
B **
2. Which line correctly finds the area of a circle in pseudocode?
A Area ← Pi * Radius ** 2
B Area ← Pi * Radius ^ 2
3. What is the value of 2 + 3 * 4 in pseudocode?
A 20
B 14
4. Score is 18 and MaxMark is 20. What does Answer ← Score * 100 / MaxMark store?
A 90
B 1800
5. What is the value of 10 - 2 ^ 3?
A 2
B 512

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Answer ← Score * 100 / MaxMark AResult ← 10 / 5
2Answer ← Pi * Radius ^ 2 BTotal ← 2 + 3 * 4
3Multiplication and division are worked out before addition and subtraction, so this gives 14, not 20 C** is Python-style power notation. Pseudocode uses ^ to raise to a power, so it should be Volume ← Side ^ 3.
4Division with / always gives a REAL result, even when the numbers divide exactly DThe letter x is used for multiplication. Pseudocode uses * to multiply, so it should be Area ← Side * Side.
5Area ← Side x Side EWorks out a percentage: Score is multiplied by 100, then divided by MaxMark, and the result is stored in Answer
6Volume ← Side ** 3 FSquares Radius first, then multiplies the result by Pi (the area of a circle)

Definitions

+ - * / ^

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Answer ← Score _ 100 / MaxMark
2.
Area ← Pi * Radius _ 2
3.
Answer ← Score * 100 _ MaxMark // Answer is always a REAL
4.
// 3 * 4 is done first, so Result is 14 Result ← 2 _ 3 * 4
5.
// Subtract the cost from the money paid Change ← Paid _ Cost

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A DECLARE Area : REAL
B Radius ← 5
C Area ← 3.14 * Radius ** 2
D OUTPUT Area
Question 2
A INPUT Score
B Answer ← Score x 100 / MaxMark
C OUTPUT Answer
Question 3
A INPUT Mark1
B INPUT Mark2
C DECLARE Average : REAL
D Average ← Mark1 + Mark2 / 2
E OUTPUT Average
Question 4
A Total ← 25
B Count ← 4
C Mean ← Total DIV Count
D OUTPUT Mean
Question 5
A Area ← Side * 2
B Perimeter ← Side * 4
C OUTPUT Area, Perimeter

Answer Key

Arithmetic operators + - * / ^ (7c)
Section A: Quick Questions
Q1
A — ^
Q2
B — Area ← Pi * Radius ^ 2
Q3
B — 14
Q4
A — 90
Q5
A — 2
Section B: Match the Pairs
Q1
Answer ← Score * 100 / MaxMark → Works out a percentage: Score is multiplied by 100, then divided by MaxMark, and the result is stored in Answer
Q2
Answer ← Pi * Radius ^ 2 → Squares Radius first, then multiplies the result by Pi (the area of a circle)
Q3
Multiplication and division are worked out before addition and subtraction, so this gives 14, not 20 → Total ← 2 + 3 * 4
Q4
Division with / always gives a REAL result, even when the numbers divide exactly → Result ← 10 / 5
Q5
Area ← Side x Side → The letter x is used for multiplication. Pseudocode uses * to multiply, so it should be Area ← Side * Side.
Q6
Volume ← Side ** 3 → ** is Python-style power notation. Pseudocode uses ^ to raise to a power, so it should be Volume ← Side ^ 3.
Section C: Definitions
Q1
+ - * / ^ — Pseudocode arithmetic operators: add, subtract, multiply, divide and ^ for power. Power, * and / are worked out before + and -. Division always gives a REAL result.
Section D: Fill in the Blanks
Q1
Answer ← Score * 100 / MaxMark
Q2
Area ← Pi * Radius ^ 2
Q3
Answer ← Score * 100 / MaxMark // Answer is always a REAL
Q4
// 3 * 4 is done first, so Result is 14 Result ← 2 + 3 * 4
Q5
// Subtract the cost from the money paid Change ← Paid - Cost
Section E: Spot the Error
Q1
C — Pseudocode does not use ** for powers. It uses ^, so the line should be Area ← 3.14 * Radius ^ 2.
Q2
B — Multiplication is written with *, not the letter x. The line should be Answer ← Score * 100 / MaxMark.
Q3
D — Division is worked out before addition, so only Mark2 is halved. Brackets are needed: Average ← (Mark1 + Mark2) / 2.
Q4
C — DIV gives only the whole-number part (6). The mean should be the exact value 6.25, so use / because division always gives a REAL result.
Q5
A — The area of a square is Side squared, which needs the power operator. It should be Area ← Side ^ 2, because Side * 2 only doubles the side.