AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Term 3 review

Week 30 · Review: Term 3 · 3 lessons
3

Data, inputs and outputs

Computing 3: Units 9–12, pp. 135–193
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.

ABCD
1BookCopiesDateMoney
2Maps511/11/2027$15.00
3Poems811/11/2027$16.00
4Space618/11/2027$21.00
Worked examples
ABCD
1BookCopiesDateMoney
2Maps511/11/2027$15.00
3Poems811/11/2027$16.00
4Space618/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.
ColumnFormatCan we add it?
BookTextno
CopiesNumberyes
DateDateno
MoneyCurrencyyes
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.
Startenter the number of ticketscost = tickets × 3show the costEnd
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?
ABC
1PondFrogsDate
2east913/04/2028
3west613/04/2028
2
Which range holds the prices in this table, and what is their total?
ABC
1FruitKgPrice
2plums2$3.50
3pears1$2.00
4grapes3$4.50
3
Name the input and the outputs of this algorithm.
StepInstruction
1When the green flag is clicked
2Switch costume to ant-a
3Go to x: −50, y: 20
4
Trace this algorithm with the input 6. What is the output?
Startenter a numberanswer = number + number + 2show the answerEnd