CAMP 1 – MODULE 3 INSIDE MATHEMATICS
Definition of variable 2. Creating and implementing formulas 3. Camp 1 - Module 3 1. Definition of variable 2. Creating and implementing formulas 3. Creating a software to build a polygon Inside Mathematics
What we will going to talk about? We will draw any polygon without drawing it! Let's draw any polygon in an automatic way! And for that, the only thing we're going to have to do is to enter the number of sides of the polygon we want to draw! In our activity's aim is to produce a software that can draw any polygon based on the number of sides entered by the user. AND HOW WILL WE DO THIS MAGIC? Inside Mathematics
1. Definition of variable Data Variables can be described as containers in the computer memory that are used to store and retrieve data. Inside Mathematics
the variable name being the label used to classify the variable box. 1. Definition of variable A variable is therefore similar to a box full of data that changes according to the events taking place in the programme we built. Data Variable the variable name being the label used to classify the variable box. Inside Mathematics
Type of Variable = String 2. Creating and implementing formulas When we create a variable, Scratch automatically builds a box in the memory and gives it the name we assigned to the variable. After having created and named a variable, the programmer can use the variable name to read or change the data contained in the box. “Grade” is the name of the numeric variable and 10 is the value contained on the variable. Grade 10 Variable = Weather String weather = Rain Type of Variable = String Current value = Rain Inside Mathematics
3. Creating a software to build a polygon In this program you will have to find the variable and the formula, ok? We will draw any polygon the user want’s, but for that they have to give us something…. A variable, that is not the name of the polygon. See some examples for polygons. What’s the only thing we need? The numbers of SIDES! That’s our variable, SIDES! Inside Mathematics
Lets make a simple software that adds two numbers! 3. Creating a software to build a polygon Lets make a simple software that adds two numbers! Variables - numA - numB Press the right key on the variable shown on the Stage >> >> Select the Cursor item Cursor mode so that we can set a number by sliding the cursor. Inside Mathematics
Lets make a simple software that adds two numbers! 3. Creating a software to build a polygon Lets make a simple software that adds two numbers! Variables - numA - numB Sum operator where the two variables will be used instead of two numerical values Initial Event > clicking the green flag > pen tool will be initialised. clear the screen from any other drawings choose the colour to draw the polygon Pen stroke size Put the pen on the Stage. Inside Mathematics
3. Creating a software to build a polygon >Sensors tab > Select Ask block and type “How many sides does our polygon have?” in the text field. Now we'll have to create a variable that will be used to store the number of sides indicated by the user in the previous question. Inside Mathematics
3. Creating a software to build a polygon At this point, we'll need to know the number and type of movements that the pen will have to perform. Inside Mathematics
Camp 1 - Module 3