you will demonstrate that you can create a repetitive turtle graphics program that responds correctly to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
you will demonstrate that you can create a repetitive turtle graphics program that responds correctly to user input. This will include following proper naming, formatting and style conventions. Description: Programs often depend upon user input. Create a turtle graphics program that draws either a square or a triangle based upon the end user's input. The program will display the turtle's state at each corner to the console. Then repeat the user prompts to allow the user to specify another shape and draw it correctly. Assignment: Create a turtle graphics Python program that performs the following: o Asks the user whether they want to draw a square or a triangle Then asks the user how long they want the sides to be o o Draws the requested shape on the screen (See Figure I below for an example) o Reports the X and Y coordinates and the turtle's heading after the turn for each corner to the console (See Table 1 below for an example) Helpful tip: The turtle will report the X and Y coordinates using decimals, use the format() function to display as integer values o Repeats the above steps to allow the user to specify a second shape to draw o The drawing window should be a color not used in the other drawing elements o The drawing window should have an appropriate title > Upload your .PY code file to the appropriate Blackboard assignment Figure 1- Example Drawing What do you want me to draw? (1 square, 2 triangle): 1 I will draw a square. 150, 8 and my heading is 90.0 How long do you want the sides of your square to be? Please enter the number of pixels (e.g. 100): 300 My 1st corner is at: My 2nd corner is at: My 3rd corner is at: My 4th corner is at: 150, 300 and my heading is 180.0 -158, 398 and my heading is 270.0 -150, e and my heading is 0.0 What do you want me to draw? (1 square, 2 triangle): 2 I will draw an equilateral triangle. How long do you want the sides of your triangle to be? Please enter the number of pixels (e.g. 100): 300 My 1st corner is at: 150,-e and my heading is 120.0 My 2nd corner is at: e, 260 and my heading is 240.0 My 3rd corner is at -150, e and my heading is 0.0 Table 2-Example Interaction and Output you will demonstrate that you can create a repetitive turtle graphics program that responds correctly to user input. This will include following proper naming, formatting and style conventions. Description: Programs often depend upon user input. Create a turtle graphics program that draws either a square or a triangle based upon the end user's input. The program will display the turtle's state at each corner to the console. Then repeat the user prompts to allow the user to specify another shape and draw it correctly. Assignment: Create a turtle graphics Python program that performs the following: o Asks the user whether they want to draw a square or a triangle Then asks the user how long they want the sides to be o o Draws the requested shape on the screen (See Figure I below for an example) o Reports the X and Y coordinates and the turtle's heading after the turn for each corner to the console (See Table 1 below for an example) Helpful tip: The turtle will report the X and Y coordinates using decimals, use the format() function to display as integer values o Repeats the above steps to allow the user to specify a second shape to draw o The drawing window should be a color not used in the other drawing elements o The drawing window should have an appropriate title > Upload your .PY code file to the appropriate Blackboard assignment Figure 1- Example Drawing What do you want me to draw? (1 square, 2 triangle): 1 I will draw a square. 150, 8 and my heading is 90.0 How long do you want the sides of your square to be? Please enter the number of pixels (e.g. 100): 300 My 1st corner is at: My 2nd corner is at: My 3rd corner is at: My 4th corner is at: 150, 300 and my heading is 180.0 -158, 398 and my heading is 270.0 -150, e and my heading is 0.0 What do you want me to draw? (1 square, 2 triangle): 2 I will draw an equilateral triangle. How long do you want the sides of your triangle to be? Please enter the number of pixels (e.g. 100): 300 My 1st corner is at: 150,-e and my heading is 120.0 My 2nd corner is at: e, 260 and my heading is 240.0 My 3rd corner is at -150, e and my heading is 0.0 Table 2-Example Interaction and Output
Expert Answer:
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these programming questions
-
(a) Discuss four benefits that would accrue to a foreign investor investing in the international bonds and (b) Highlight four conditions that must be met by a subsidiary before it could be considered...
-
Write a literature review for your study. See below for an example of a literature review. Your literature review should provide both analysis and synthesis of previous studies as related to the...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Caine Bottling Corporation is considering the purchase of a new bottling machine. The machine would cost $200,000 and has an estimated useful life of 8 years with zero salvage value . Management...
-
Begin with a 1-in-square thin-wall steel tube, wall thickness t = 0.05 in, length 40 in, then introduce corner radii of inside radii ri, with allowable shear stress τall of 11 500 psi, shear...
-
Park Shoe Shop, Ltd. had goods available for sale in 2017 with a retail price of 120,000. The cost of these goods was 84,000. If sales during the period were 90,000, what is the estimated cost of...
-
A salad shop offers eleven sauces. No sauce is used more than once. What is the probability that the sauces in a four-sauce salad are mayonnaise, mustard, barbecue, and red chili?
-
Dilberts Department Store is trying to determine how many Hanson T-shirts to order. Currently the shirts are sold for $21, but at later dates the shirts will be offered at a 10% discount, then a 20%...
-
A block of mass 2 kg is attached to a spring with a spring constant of 100 N/m. The block is released from rest and moves along a rough horizontal surface with a coefficient of friction of 0.2. How...
-
Spears was seeking employment and negotiating both with Amazon.com and with a firm called Intelligrated. Amazon made 2 offers to Spears which he rejected, because he believed they did not pay enough,...
-
The comparative balance sheets of Lesley Leary Design Studio, Inc., at June 30, 2012 and 2011, and transaction data for fiscal 2012, are as follows: Transaction data for the year ended June 30, 2012,...
-
Company estimates that the total factory overhead for the following year will be 1,250,000 The company has decided that the basis for applying factory hould be machine hours, which is estimated to be...
-
Delph Company uses a job - order costing system with a plantwide predetermined overhead rate based on machine - hours. At the beginning of the year, the company estimated that 5 2 , 0 0 0 machine -...
-
A company's Cash account shows a balance of 3 , 4 5 0 at the end of the month. Comparing the company's Cash account with the monthly bank statement reveals several additional cash transactions such...
-
Save Co. had the following information for its fiscal year ending December 31, 2023: Net income for 2023 $520,000 Retained earnings, January 1, 2023 210,000 Cash dividends declared on common shares...
-
How big data analysis can be used effectively in an area of auditing accounting. Provide specific examples to support your position on the use of big data. Include an issue and how big data analysis...
-
Illustration 18 From the following information, you are required to prepare Trading and Profit and Loss Account for the year ended 31 st December 2004 and a Balance Sheet as on that date. 1-01-2004...
-
The area of a rectangle is 30 cm 2 and its perimeter is 26 cm. Find the length and width of the rectangle.
-
The plaintiffs in this case are persons injured when an aerial shell at a public fireworks exhibition went astray and exploded near them. The defendant is the pyrotechnic company hired to set up and...
-
Salem Supply Co. sells new and used gardening equipment. Ben Buyer purchased a slightly used riding lawn mower for $1,500. The price was considerably less than that of comparable used mowers. The...
-
Discuss the rule that aids in the interpretation of a contract.
-
Isothermal compression efficiency can be achieved by running the compressor: (a) At a very high speed (b) At a very slow speed (c) At an average speed (d) At zero speed
-
Derive the expression of work done by the compressor in isothermal compression, adiabatic compression, and polytropic compression.
-
Maximum work is done in compressing air when the compression is: (a) Isothermal compression (b) Adiabatic compression (c) Polytropic compression (d) None of these
Study smarter with the SolutionInn App