Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python (.py file) Note: Please comment the steps and post a screenshot of your output, source code, and trials. Also include the spaces, indents, and

Python (.py file)

Note: Please comment the steps and post a screenshot of your output, source code, and trials. Also include the spaces, indents, and new lines. Thank you.

image text in transcribedimage text in transcribedimage text in transcribed

Skee Ball is an arcade game that lets players roll a ball up an angled surface and into a series of "hoops". Players earn points based on which hoop their ball Springs into. See the image below to see what the game looks like in real life if you haven't had the chance to play it yourself. 3.0 10 For this program you will be writing some code that will simulate the rolling of balls into a virtual Skee Ball playing area. To do this you can repeatedly generate a random coordinate within the Skee Ball area and test to see which hoop (if any) the ball Springs into. Note that the playing field is 48" wide by 60* high, so you will be generating random coordinates within this range as part of your simulation. when you are finished you should calculate the % chance of a ball Springing into a particular hoop Refer to the schematic be for the exact measurement of eSkee Ball board. Hint: Start off by simulating just one ball toss. Once you are confident that you have designed an effective algorithm you can scale up and place your code inside a loop. origin = (0,0) -top left 48 inches wide 0 points 40 points diameter = 8 in center = (24, 5) 30 points diameter-10 in center-(24, 26) (( 20 points diameter - 12 in center(24, 38) 10 points diameter- 36 in center(24, 38) Here are a few sample runs of the program: How many throws would you like to simulate? 5000088 Done! Execution time: 20.00 seconds * Total throws : * Misses: 18 points: * 28 points: * 38 points: k 48 points: 5,000,000 100.00% 3,144,407 62.89% 1,436,146 28.72% 195,887 3.92% 136,021 2.72% 87,539 1.75% How many throws would you like to simulate? -50 Sorry, try again How many throws would you like to simulate? 100008 Done! Execution time: 0.39 seconds Total throws: * Misses: * 18 points: 28 points: k 30 points: * 48 points: 100,000 100.00% 62,856 62.86% 28,689 28.69% 3,943 3.94% 2,717 2.72% 1,795 1.80% Some hints: .You can generate a random floating point number within a given range by using the random.uniformO function. This function takes two arguments - a low boundary and a high boundary - and generates a floating point number within this range (edges inclusive) .You can ask Python to generate the current time by calling the time.time0 function. You will need to import the time module in order to call this function. . You will need to format your output to match the sample output above (i.e. all of your values should line up)

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions