GoalReview spreadsheets, formats and ranges, and the inputs and outputs of algorithms.
New words
range · a group of selected cells, such as B2:B4input · what we give to an algorithm or what starts itoutput · the result, or what the sprite does
Explanation
A spreadsheet has rows, which go across, and columns, which go up and down. A cell is where a row and a column cross, and its address is the column letter and then the row number, such as B3. Data has a format: Text, Number, Date or Currency. We can add up Number and Currency data, and we choose the range of cells that holds the data we need. An algorithm also has an input and an output. The input is what starts it or what we give it, and the output is what comes out or what the sprite does. A reset algorithm puts a sprite back at its start when the green flag is clicked.
A
B
C
D
1
Book
Copies
Date
Money
2
Maps
5
11/11/2027
$15.00
3
Poems
8
11/11/2027
$16.00
4
Space
6
18/11/2027
$21.00
Worked examples
A
B
C
D
1
Book
Copies
Date
Money
2
Maps
5
11/11/2027
$15.00
3
Poems
8
11/11/2027
$16.00
4
Space
6
18/11/2027
$21.00
Look at the book fair sheet. The Copies column is in B2:B4. It is in the Number format, so we can add it: 5 + 8 + 6 = 19 copies. The address of “Poems” is A3.
Column
Format
Can we add it?
Book
Text
no
Copies
Number
yes
Date
Date
no
Money
Currency
yes
The Money column holds Currency data. The range is D2:D4. The total is $15.00 + $16.00 + $21.00 = $52.00. The dates in C2:C4 are Date data. We read them, but we do not add them.
An algorithm can ask for data too. Here is one with one input statement and one output statement. Tickets cost $3 each. With 4 tickets the output is 4 × 3 = $12.
Class activity
Spreadsheet and algorithm quiz (in pairs): draw the book fair sheet on paper. Take turns to ask “What is the address of …?” and “Which range would you select to find …?” Then write an algorithm with an input and an output, such as “Enter a number. Add 5. Show the answer”, and trace it with three inputs. Finally write a reset algorithm for a sprite, with the green flag as its input.
Practice
1
What is the address of the cell that holds 6, and what is the format of the Date column?
A
B
C
1
Pond
Frogs
Date
2
east
9
13/04/2028
3
west
6
13/04/2028
The 6 is in column B and row 3, so it is B3. The Date column has the Date format.
2
Which range holds the prices in this table, and what is their total?
A
B
C
1
Fruit
Kg
Price
2
plums
2
$3.50
3
pears
1
$2.00
4
grapes
3
$4.50
C2:C4. $3.50 + $2.00 + $4.50 = $10.00.
3
Name the input and the outputs of this algorithm.
Step
Instruction
1
When the green flag is clicked
2
Switch costume to ant-a
3
Go to x: −50, y: 20
The input is clicking the green flag. The outputs are the costume ant-a and the place x: −50, y: 20.
4
Trace this algorithm with the input 6. What is the output?