Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Use python program language. Kindly include code with comments (to help with understanding) and screenshot of output Reference code in star_pattern_template.py: Import additional modules

Please Use python program language. Kindly include code with comments (to help with understanding) and screenshot of output

image text in transcribed

Reference code in star_pattern_template.py:

"""Import additional modules below this line (starting with unit 6)."""

from turtle import *

"""Write new functions below this line (starting with unit 4)."""

def start():

"""This function initializes the window and the turtle.

Do not modify this function or any of the properties it sets.

"""

setup(564, 564)

width(7)

side_length = 60 # Also the radius of a circle enclosed by the star.

penup()

goto(0, -side_length) # Start at the bottom of the star.

pendown()

def main():

"""Write your mainline logic below this line (then delete this line)."""

"""Do not change anything below this line."""

if __name__ == '__main__':

start()

main()

done()

05.3 - Star Pattern Starting with the code provided in star_pattern_template .py, use a loop with turtle graphics to draw a star pattern that has a user specified number of points. First ask the user how many points they want on the star. Then draw the star by having the turtle trace its perimeter. The inner angle of a star point A will be equal to 360 divided by the number of points on the star. A=360/points The concave angle between star points B will be twice the inner angle. B=2A Figure 1: A five point star for Exercise 05.3. Test your code by comparing your results to the five point star above and the two additional test cases shown below. You may choose any colors except white as long as you use a different color for the outline as you use for the fill. Save your program as star_pattern_login.py, where login is your Purdue login. Then submit it along with a screenshot showing all 3 test cases. Hints: - Do not modify the size of the canvas provided in the template. - Start drawing from the bottom inner point. - Each length of each side should be 60 pixels. - The initial angle is different from A or B and should be set outside of your loop. Table 1: Additional test cases for Exercise 05.3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started