Python scripting

profileAdejoke
CIS1234.5PerformanceAssessment.docx

Performance Assessment 4.5 – Advanced Turtle Graphics

Task 1 – Pseudocode

Now you are going to create pseudocode for three functions square, circle, and triangle along with the main program. These functions should put a shape onto the turtle screen of a specific size.

Let’s start with the pseudocode

Function square

· Create a function that draws a square (4 sides, each the same length) on the turtle screen.

End.

Function circle

· Create a function that draws a circle when it is called.

End.

Function triangle

· Create a function that draws a triangle when it is called

End.

Program Main

· Call all three new functions

End.

Deliverables for Task 1

· Pseudocode to functions and main program to import and use them.

Task 2 – Writing the program for advanced turtle graphics

Now create a new file named TurtleGraphics_PA42 in your IDLE. Don’t forget to include a print statement at the top of the program which prints out your student ID.

Create a function named square, circle, and triangle which will draw those shapes onto the turtle screen.

Run the main program that calls all three functions.

Take a screenshot of your completed program and another of your output.

Deliverables for Task 2

· Screenshot of your completed program and the output

Task 3 – Allow the size to be passed to the functions

Change the program to allow the user to enter the size of the shapes before the functions are called.

Take a screenshot of your completed program and another of your output.

Deliverables for Task 3

· Screenshot of your completed program and the output