solve problems and create computational representations of mathematical situations using coding concepts and skills
solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves conditional statements and other control structures
“If then” statements:
“If then else” statements:
Have students write code to find the area of a rectangle. To set up the task, discuss what variables will be important to include in the code: What information do you need to determine the area of a rectangle? How do you know?
Next, have students develop a program that receives input (dimensions of the rectangle) from a user and provides the area of a rectangle as output.
Next, have students adapt their code so that it allows the user to compare the area of two different rectangles.
read and alter existing code, including code that involves conditional statements and other control structures, and describe how changes to the code affect the outcomes
Provide students with the code shown below, which creates a numerical growing pattern through 10 repeats of adding 2.5. Have them alter the code so that it generates a different numerical growing pattern for outputs of less than 50:
Ask students to modify their code from C3.1: Sample Task 1 so that the code compares the areas of two triangles. For example: