Browse By

Scratch – Math Concepts: Online Course

Square

A square is a four-sided polygon which has it’s all sides equal in length and the measure of the angles are 90 degrees.

Properties of a Square

The most important properties of a square are listed below:

  • All four angles are equal to 90°
  • All four sides of the square are equal to each other
  • The opposite sides of the square are parallel to each other
  • The diagonals of the square bisect each other at 90°
  • The two diagonals of the square are equal to each other
  • The square has 4 vertices and 4 sides
Scratch Program to calculate Area and Perimeter of Square

Scratch Program to calculate Area and Perimeter of Square: To do this, we need to follow these steps

Step1: Area and Perimeter of Square formula:

Area of Square
Area = side2 per square unit
If ‘a’ is the length of the side of square, then;
Area = a2 sq.unit
Perimete of Square
Perimeter = Side + Side + Side + Side = 4 Side
           Perimeter = 4 × side of the square 
If ‘a’ is the length of side of square, then perimeter is:
Perimeter = 4a unit

Step 2: Let a square have side equal to 6 cm. Find out its area and perimeter.

Given, side of the square, s = 6 cm
Area of the square = s2 = 62 = 36 cm2
Perimeter of the square = 4 ×  s = 4 × 6 cm = 24cm

Step 3: Procedure

  • First Define Variable: three variables identified for this scratch program. I will list them here:
  1. Side = s
  2. Square = sqr
  3. Perimeter = Per

From Events, Drag green flag() block on sprite area.

  • Click on the “variables” tab (top left), and click  “Make a variable”. Now type “s”, in the  dialogue box.
  • Repeat this, and create a ‘Perimeter’, ‘Area’ variable.
  • From Variables, Drag the set() block ‘set variable to 0’ Initialize ‘s’ variables to 0 (eg : my variable = s).
  • To Replace 0 value from your value in set() block where variable is ‘D’
  • From Sensing, Drag the ask() block , Change text and asks the user to ‘Perimeter of Square′.
  • From operator, Drag a three additional() block and replace 0 value from this three additional block with variable into set() block.
  • From looks block, drag a say() block stays for the specified amount of time.
  • Drag the variable block and let it replace the value hello! from variable into say() block.
  • Repeat previous four process again for Area of square.
  • When the green flag is clicked, the script activates.
  • To run the program. You should get the following result.

Input & Output