C3.1 Solve problems and create computational representations of mathematical situations by writing and executing efficient code, including code that involves conditional statements and other control structures.
Activity 1: Perimeter and Area
The students will write code that will determine the area and perimeter of a geometric shape using their formula. They will:
- determine the appropriate commands or blocks to represent the area or perimeter formula with code;
Example
Use "operator" blocks to represent operations in calculations.
Note: There is more than one possible representation of a formula; for example, the perimeter could be expressed with the following blocks:
- ensure that the data is provided by the user.
Example
Use the "ask" block to define variables.
A code that makes this task happen might look like this:
Source: Scratch.
Activity 2: Budget
The students will be required to use a spreadsheet to automatically account for a series of expenses.
They will need to use commands such as "SUM" and "MINUS" to make automatic calculations when data is entered in a cell range.
They may also use conditional formatting to distinguish expenses (credit, cash, check, etc.) or to determine whether or not the sum of the expenses is within a budget.
For example, the student uses a spreadsheet to organize a lemonade sales business, collect data during a week of sales, and use measures of central tendency to make predictions about future sales.
Spreadsheet example (showing formulas)
Note: The spreadsheet recognizes the formula "=SUM".
Example of the table (showing values)