GoalReview flowcharts, spreadsheets and data questions from Units 1 and 2.
New words
flowchart · a diagram that uses shapes and arrows to show the steps of an algorithmtrace · to follow the steps one at a time and write down what happensformula · a calculation that starts with = and uses cell referencesclosed question · a question with a fixed set of answers to choose from
Explanation
A flowchart shows an algorithm. An oval is the start or the stop, a parallelogram is for input or output, a rectangle is for a process, an action such as a calculation and a diamond is for a decision. A loop sends an arrow back to an earlier step. A decision has a yes branch and a no branch, and one branch may hold another decision. To trace a flowchart, write down the value of every variable after each step. In a spreadsheet, every cell has a name such as B3, and a range such as B2:B6 is a block of cells. A formula starts with =, and the functions SUM, AVERAGE, MAX and MIN work on ranges. Check every answer by working it out by hand. A closed question gives a fixed set of answers, and an open question lets people write whatever they like.
Shape
Meaning
oval
start or stop
parallelogram
input or output
rectangle
a process
diamond
a decision with yes and no
rectangle with two side lines
a sub-routine
Worked examples
Trace this flowchart. The variable stairs starts at 0. The question ‘stairs below 3?’ is yes for 0, 1 and 2, so the loop runs three times and says Up! each time. When stairs is 3 the answer is no, so the flowchart says Top! and stops.
Here a decision sits inside the no branch. For 3 degrees the answer to the first question is yes, so it shows Wear a coat. For 10 degrees the first answer is no and the second is yes, so it shows Wear a jumper. For 15 degrees both answers are no, because 15 is not below 15.
B7fx=SUM(B2:B6)
A
B
C
1
Day
Bees
Butterflies
2
Mon
7
3
3
Tue
5
6
4
Wed
9
4
5
Thu
6
8
6
Fri
8
4
The sheet above counts the insects seen in a garden. To find the total number of bees we select B2:B6 and write =SUM(B2:B6). The bees are 7 + 5 + 9 + 6 + 8 = 35. The average is 35 ÷ 5 = 7, from =AVERAGE(B2:B6).
Class activity
Human flowchart (no computer): draw the stairs flowchart in big shapes on separate sheets of paper and lay them on the floor with arrows. One person is the variable stairs and holds a number card. A second person walks along the path and follows each shape, changing the number card when an action says so. Say each output out loud. Then change the question to ‘stairs below 5?’ and play again. How many times is Up! said? If you have a computer or tablet, draw the flowchart with a drawing tool.
Practice
1
Trace the flowchart. What does it show at the end, and how many times does the loop run?
cups goes 10, 8, 6, 4. At 4 the question ‘cups more than 4?’ is no, so the loop stops. The loop runs 3 times and the flowchart shows 4.
2
Draw a flowchart for this algorithm: type a mark; if the mark is 50 or more, show Pass; if not, show Try again.
Start, then a parallelogram ‘type the mark’, then a diamond ‘mark 50 or more?’. The yes branch goes to a parallelogram ‘show: Pass’ and the no branch goes to ‘show: Try again’. Both branches join and go to Stop.
3
Use the garden sheet in the third worked example. Write the function and the answer for (a) the total number of butterflies and (b) the difference between the most and the fewest butterflies.