Arithmetic operators + - * / ^ (7a)

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

Arithmetic operators + - * / ^ (7a)

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 Cambridge pseudocode?
A **
B ^
2. Which line correctly calculates the area of a circle?
A Area ← Pi * Radius ^ 2
B Area ← Pi * Radius * 2
3. What is the value of 2 + 3 * 4?
A 20
B 14
4. What is the value of (2 + 3) * 4?
A 20
B 14
5. Score is 45 and MaxMark is 60. Which line gives the percentage?
A Answer ← Score * 100 / MaxMark
B Answer ← Score + 100 / MaxMark

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 ASquares Radius first (power), then multiplies the result by Pi
2Area ← Pi * Radius ^ 2 BAverage ← (Maths + English) / 2
3Multiplication and division are worked out before addition and subtraction, so 3 is multiplied by 4 first CMultiplies Score by 100, then divides the result by MaxMark to work out a percentage
4Brackets make the order clear and force the addition to be done first DTotal ← 2 + 3 * 4
5Average ← Maths + English / 2 EThe brackets make Pi * Radius be multiplied first and then squared, so Pi is squared too. It should be Pi * Radius ^ 2.
6Area ← (Pi * Radius) ^ 2 FWithout brackets, English / 2 is worked out before the addition, so this is not the average of the two marks. It should be (Maths + English) / 2.

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.
Average ← (Maths + English) _ 2
4.
Total ← (Cost _ Tax) * Quantity
5.
Change ← Paid _ Cost

Spot the Error

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

Question 1
A Score ← 56
B Answer ← Score ^ 100 / 80
C OUTPUT Answer
Question 2
A Radius ← 5
B Pi ← 3.14
C Area ← Pi * Radius * 2
D OUTPUT Area
Question 3
A INPUT Length
B INPUT Width
C Area ← Length * Width
D Perim ← 2 * Length + Width
E OUTPUT Perim
Question 4
A M1 ← 70
B M2 ← 80
C M3 ← 90
D Mean ← M1 + M2 + M3 / 3
E OUTPUT Mean
Question 5
A Distance ← 150
B Speed ← Distance // 3
C OUTPUT Speed

Answer Key

Arithmetic operators + - * / ^ (7a)
Section A: Quick Questions
Q1
B — ^
Q2
A — Area ← Pi * Radius ^ 2
Q3
B — 14
Q4
A — 20
Q5
A — Answer ← Score * 100 / MaxMark
Section B: Match the Pairs
Q1
Answer ← Score * 100 / MaxMark → Multiplies Score by 100, then divides the result by MaxMark to work out a percentage
Q2
Area ← Pi * Radius ^ 2 → Squares Radius first (power), then multiplies the result by Pi
Q3
Multiplication and division are worked out before addition and subtraction, so 3 is multiplied by 4 first → Total ← 2 + 3 * 4
Q4
Brackets make the order clear and force the addition to be done first → Average ← (Maths + English) / 2
Q5
Average ← Maths + English / 2 → Without brackets, English / 2 is worked out before the addition, so this is not the average of the two marks. It should be (Maths + English) / 2.
Q6
Area ← (Pi * Radius) ^ 2 → The brackets make Pi * Radius be multiplied first and then squared, so Pi is squared too. It should be Pi * Radius ^ 2.
Section C: Definitions
Q1
+ - * / ^ — Arithmetic operators: add, subtract, multiply, divide and power. ^ is worked out first, then * and /, then + and -. Brackets change or clarify the order.
Section D: Fill in the Blanks
Q1
Answer ← Score * 100 / MaxMark
Q2
Area ← Pi * Radius ^ 2
Q3
Average ← (Maths + English) / 2
Q4
Total ← (Cost + Tax) * Quantity
Q5
Change ← Paid - Cost
Section E: Spot the Error
Q1
B — ^ raises Score to the power of 100, which gives a huge number. To turn the score into a percentage you multiply by 100, so it should be Score * 100 / 80.
Q2
C — Radius * 2 doubles the radius. The area of a circle needs the radius squared, so the power operator is needed: Pi * Radius ^ 2.
Q3
D — Without brackets, 2 * Length is worked out first and then Width is added. Brackets are needed so both sides are added before doubling: 2 * (Length + Width).
Q4
D — Division is done before addition, so only M3 is divided by 3. The three marks must be added inside brackets first: (M1 + M2 + M3) / 3.
Q5
B — // starts a comment in Cambridge pseudocode, so the division would not happen. The divide operator is a single /, so it should be Distance / 3.