INQ241A
Mobile Apps

Activity 3

Variables

  1. Create a new script that uses a Turtle to draw a simple house like the following:

    house
    The first line of code of your script must be the definition of a variable called width and the house that the script draws must be the width specified by the width variable.

    Note that the bottom of the house is a square and that the top of the house is an equilateral triangle.

  2. Create a new script that uses a Turtle to draw a fish like the following:

    fish
    The first line of code of your script must be the definition of a variable called height and the fish that the script draws must be the height specified by the height variable.

    Note that the circumference, c, of a circle can be computed from the radius, r, with the following equation:

    c = 2 π r

    Use math → pi in TouchDevelop to get the value of π. Also note that this is much more simple if the curves in your drawing use a turn angle of 1 degree.

Submission

Please show your source code and run your scripts for the instructor or lab assistant.