Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | May 2017 |
Last Sign in: | 305 Weeks Ago, 4 Days Ago |
Questions Answered: | 66690 |
Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Your sports league uses the following lottery system to select draft picks for the four worst teams in the league:
â– The last place team gets 20 balls in an urn.
â– The second-to-last place team gets 10 balls in the urn.
â– The third-to-last place team gets 6 balls in the urn
â– The fourth-to-last place team gets 4 balls in the urn
To determine the first pick in the draft a ball is selected at random. The team owning that ball gets the first pick. The ball is then put back in the urn. To determine the second pick in the draft a ball is selected at random. If the ball belongs to the team that got the first pick then it is put back in and the process repeats until a ball is selected that does not belong to the first pick. To determine subsequent picks in the draft the process repeats until a ball is selected that belongs to a team that has not already been chosen. Write a function that takes as input which of the four teams have already been granted picks, simulates selecting a ball from the urn according to the lottery rules, and returns the team that belongs to the selected ball. You get to choose how to design your function to perform these actions. Write a main function that outputs the draft order (e.g., a possible order is: secondto-last picks 1, last place picks 2, third-to-last picks 3, and fourth-to-last picks 4). If you change the random seed then the order should differ if you run the program multiple times. For a slightly harder version of the problem, allow the user to input the names of the four teams. The program should then output the team names in the draft order.
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------