Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below it the code for the Labs 1-3 makeup. Please code in python import turtle #Taking input from the user n=input(Enter the number of sides

Below it the code for the Labs 1-3 makeup. Please code in python

image text in transcribed

import turtle #Taking input from the user n=input("Enter the number of sides of polygon:"); n=(int)(n) if(n>=3 and n

andrew.shape("turtle") # alex looks like a turtle #calculating angle angle=360 andrew.color("green") i=1 while(i Create a program that will modify Labs 1-3 makeup to contain three functions (one main and two other functions) The main function will contain input and calls to your other functions You should create value-returning function to robustly confirm that the user's input is between 3 and 12 inclusive. This function should accept 1 parameter and return 1 value that is between 3 and 12 inclusive The other function is void function that accepts one parameter for the number of sides of the polygon and will use a for loop to output the polygon. This function should contain all the turtle commands. Nothing should be returned to the function call from this function. Your main function should prompt the user to enter a value between 3 and 12 for the number of sides of the polygon. Next your main function should call the function to check the input. Finally your main function should call the function to draw the polygon. Import turtle before all your programmer built functions Do not use the same variable name in multiple functions. Remember to write introductory for the entire program at the very beginning of your program. Also write comments for the function to check input and to draw the polygon immediately before these functions. Refer to the demo programs as examples. You do not have to write special comments for the main function

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

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

3. Define the attributions we use to explain behavior

Answered: 1 week ago