Ask the user to enter an integer number of dots to draw before drawing anything. Use...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Ask the user to enter an integer number of dots to draw before drawing anything. Use a while loop to make sure that the user enters a number bigger than 0. Once the user enters a valid amount, draw a circular target with 3 concentric circles centered at (0, 0) on a 500 by 500 screen. (Use any colors you like but do NOT use random colors. Check the Adobe Color Wheel for some cool ones.) The innermost circle should have a radius of 50. The circle surrounding that should have a radius of 100. And, the circle surrounding that should have a radius of 150. After drawing the target use a for loop to draw the given number of dots entered by the user, one dot for each time around the loop. Each dot should be drawn at a random location with each coordinate between -200 and 200. Each dot should be of size 10 and should be drawn in a specified (not random) color based on where it falls in the target. Dots outside of the target should be drawn in black. (Make sure that the colors of the dots contrast with the colors of the target rings or else you won't see the dot. Note that this program does NOT use random colors. You pick the colors that will go in each ring of the target.) The program should count the number of dots that fall in each region as well as outside of the target. Below the loop (not inside it), the program should display in the shell (not in the drawing window) the number of dots in each region and calculate and display the percentage of dots in each region. Display the percentage with one decimal place. To be able to determine whether a dot is inside of a region within the circle, you will need to calculate the distance between the position of the dot (x, y) and the center of the circle which is at (0, 0). The formula for the distance is: dist = √√√x² + y² Once the distance is calculated, you will need to use an if/elif statement to determine where the dot is by comparing the distance against the various radii starting with the one for the innermost circle. Ask the user to enter an integer number of dots to draw before drawing anything. Use a while loop to make sure that the user enters a number bigger than 0. Once the user enters a valid amount, draw a circular target with 3 concentric circles centered at (0, 0) on a 500 by 500 screen. (Use any colors you like but do NOT use random colors. Check the Adobe Color Wheel for some cool ones.) The innermost circle should have a radius of 50. The circle surrounding that should have a radius of 100. And, the circle surrounding that should have a radius of 150. After drawing the target use a for loop to draw the given number of dots entered by the user, one dot for each time around the loop. Each dot should be drawn at a random location with each coordinate between -200 and 200. Each dot should be of size 10 and should be drawn in a specified (not random) color based on where it falls in the target. Dots outside of the target should be drawn in black. (Make sure that the colors of the dots contrast with the colors of the target rings or else you won't see the dot. Note that this program does NOT use random colors. You pick the colors that will go in each ring of the target.) The program should count the number of dots that fall in each region as well as outside of the target. Below the loop (not inside it), the program should display in the shell (not in the drawing window) the number of dots in each region and calculate and display the percentage of dots in each region. Display the percentage with one decimal place. To be able to determine whether a dot is inside of a region within the circle, you will need to calculate the distance between the position of the dot (x, y) and the center of the circle which is at (0, 0). The formula for the distance is: dist = √√√x² + y² Once the distance is calculated, you will need to use an if/elif statement to determine where the dot is by comparing the distance against the various radii starting with the one for the innermost circle.
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that accomplishes the task you described python impo... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
If you had excavated and removed all soils from the top of a rock formation, and now had excavated to reveal a face of solid rock, would you have to slope the face, or is it considered solid rock?
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
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...
-
Q No. 1) a) Construct the Histogram for the following frequency distribution relating to the ages of telephone operators. Age (Years) No. of Operators 10-15 15-20 20-25 25-30 30--35 10 22 17 b)...
-
The shower head in Fig P6.142 delivers water at 50°C. An orifice-type flow reducer is to be installed. The upstream pressure is constant at 400 kPa. What flow rate, in gal/min, results without...
-
A sample of 30 data observations has a sample mean x- = 14.62 and a sample standard deviation s = 2.98. bind the value of C for which (c. ) is a one sided 95% t-interval for the population mean ....
-
What factors affect takeoff performance?
-
Papas Restaurant Corporation wholesales ovens and ranges to restaurants throughout the Northeast. Papas Restaurant Corporation, which had 18,000 shares of common stock outstanding, declared a 4-for-1...
-
(1) What was the background of Mr Wang Gang? What was his character? How did these two elements help him in his career development? (2) What was the benefits for Mr Wang Gang to have a partner? What...
-
Major Project - Andrew Best - Best Business Solutions Incorporated (BBSI) Andrew Best was a very inquisitive child growing up. He was a great student in school and always asked a lot of questions....
-
All files have the following three kinds of permissions. Find out the detailed semantics for each: File Directory R Read W Write X Execute File
-
How do advancements in genetic research intersect with conceptions of ethnicity, and what are the ethical implications of utilizing such data in biomedical research and public policy?
-
How does ethnicity intersect with notions of cultural hegemony and power dynamics within contemporary societies?
-
What methodologies are employed in studying the nuanced construction and negotiation of ethnic identities in multicultural societies?
-
George has a concession stand at a local baseball park. During games, they sell hot dogs for $4 each and hamburgers for $5 each. During one inning, they sell a total of 10 items for $43. How many of...
-
How do social constructionist frameworks inform our understanding of the relationship between individual agency and social structure, particularly in terms of navigating identity formation and social...
-
A low degree of operating leverage means there are low fixed costs. there is low debt. there is a large amount of equity. there are high overhead costs.
-
on 8 For the following set of lengths 130, 170, 160, 160, 150, 190 Third quartile is: et red d out of Select one: O a. 160 a question O b. 145 O c. 175 O d. 180
-
During 2012, William purchases the following capital assets for use in his catering business: New passenger automobile (September 30)........................$21,500 Baking equipment (June 30)...
-
Diane is a single taxpayer who qualifies for the earned income credit. Diane has two qualifying children who are 3 and 5 years old. During 2012, Diane's wages are $17,100 and she receives dividend...
-
Carl and Jenny adopt a Russian orphan. The adoption takes 2 years and two trips to Russia and is final in 2012. They pay $6,000 in 2011 and $7,500 in 2012 of qualified adoption expenses, and have AGI...
-
Using the data in exercise 2, determine how many units of resources the firm will want to acquire. Data from in exercise 2 Using the information in the following table, calculate the marginal revenue...
-
What does it mean to say that the demand for resources is a derived demand? Is the demand for all goods and services a derived demand?
-
Using the information in the following table, calculate the marginal revenue product (MRP = MPP MR). Unit of Resources Total Resource Output Price Price 1 10 $5 $10 2 25 $5 $10 345 35 $5 $10 40 $5...
Study smarter with the SolutionInn App