C3.2 Read and alter existing code involving the analysis of data in order to inform and communicate decisions, and describe how changes to the code affect the outcomes and the efficiency of the code.

Activity 1: Right-Angle Triangle or Not?


Introduce this code to students:

Block of codes:Events block stating, ‘’when green flag is clicked.’’Variables block stating, ‘’set a to 0’’.Variables block stating, ‘’set b to 0’’.Variables block stating, ‘’set c to 0’’.Sensing block stating, ‘’ask what is the measurement of A, question mark, and wait.’’Control block stating, ‘wait 1 seconds’’.measurement of B, question mark, and wait.’’Control block stating, ‘wait 1 seconds’’.measurement of C, question mark, and wait.’’Control block stating, ‘wait 1 seconds’’.Control block stating, ‘’if a, plus, a, plus, b, plus, b, equals, c, plus, c, then’’.Inside one nested block.Says block stating, ‘’say this is a right angle triangle., exclamation mark, for 2 seconds. ‘’Control block stating, ‘’else’’Inside one nested block.Says block stating, ‘’say this is not a right angle triangle, exclamation mark, for 2 seconds. ‘’

Ask if this code can determine if a triangle is a right-angle triangle. If not, ask students to alter the code so that it can determine if a triangle is a right-angle triangle.

Activity 2: Spreadsheets


Present the following spreadsheet to students:

Class 1
Bin Total Number of Objects Number of Items in the Right Bin Number of Items in the Wrong Bin Percentage
Recycling - Paper 54 33 21 61.11%
Recycling - Plastic and Metal 42 26 16 61.90%
Garbage Can 31 25 6 80.65%
Compost 12 10 2 83.33%

Class 2
Bin Total Number of Objects Number of Items in the Right Bin Number of Items in the Wrong Bin Percentage
Recycling - Paper 64 25 39 39.06%
Recycling - Plastic and Metal 78 64 14 82.05%
Garbage Can 51 25 26 49.02%
Compost 3 2 1 66.67%

Ask students what they observe.

Knowing that the acceptable threshold for the Eco-School program is 80%, ask students what they could do to improve the visualization of the above tables.