The program will simulate spinning a wheel that has been numbered 1 through 16. Not only...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The program will simulate spinning a wheel that has been numbered 1 through 16. Not only is the wheel numbered, but it also has colors and a designated jackpot value. Each time the wheel spun, the number is output along with either the color or label for the number: The number 16 on the wheel indicates a Jackpot. When the program starts, it will ask the user how many time to spin the wheel. The user must enter a number between 4 and 10. Then the program will simulate spinning the wheel that number of times. Sample Output: How many times do you want to spin the wheel? 3. Enter a number between 4 and 10. How many times do you want to spin the wheel? 8 Spin 1: 6 ==> Green Spin 2: 13 ==> Yellow Spin 3: 10 ==> Yellow Spin 4: 16 ==> JACKPOT! Spin 5: 3 ==> Green Spin 6: 2 ==> Red Spin 7: 14 ==> Red Spin 8: 11 ==> Red Thanks for playing! Otherwise, it is represented by a color: o If the number divides by 3 exactly, the color is Green. o If the number divided by 3 has a remainder of 1, the color is Yellow. If the number divided by 3 has a remainder of 2, the color is Red. o The program should have TWO functions: main - This function is the main routine. It should do the following: Ask the user how many times they want to spin the whell, If the user enters a number less than 4 or greater than 10, the program should continue to ask the user for a valid number between 4 and 10. o Remember you can use a while loop to do input validation. Once the program has a valid number from the user, it should use that number as an argument when calling the spin wheel function. . Rin wheel-This function has one parameter, spins, which is the number of times to spin the wheel. • . . . Use a for loop to spin the wheel the number of times specified. Use the randint function from the random module to get a random digit between 1 and 16 inclusive. Print the number of the loop iteration and the spin value as indicated in the Sample Output. o The number of the loop iteration should start with 1. o The spin value should include the number and either the color of the number or "JACKPOT!" in the case of number 16. After the for loop is complete, print a message thanking the user for playing. The program will simulate spinning a wheel that has been numbered 1 through 16. Not only is the wheel numbered, but it also has colors and a designated jackpot value. Each time the wheel spun, the number is output along with either the color or label for the number: The number 16 on the wheel indicates a Jackpot. When the program starts, it will ask the user how many time to spin the wheel. The user must enter a number between 4 and 10. Then the program will simulate spinning the wheel that number of times. Sample Output: How many times do you want to spin the wheel? 3. Enter a number between 4 and 10. How many times do you want to spin the wheel? 8 Spin 1: 6 ==> Green Spin 2: 13 ==> Yellow Spin 3: 10 ==> Yellow Spin 4: 16 ==> JACKPOT! Spin 5: 3 ==> Green Spin 6: 2 ==> Red Spin 7: 14 ==> Red Spin 8: 11 ==> Red Thanks for playing! Otherwise, it is represented by a color: o If the number divides by 3 exactly, the color is Green. o If the number divided by 3 has a remainder of 1, the color is Yellow. If the number divided by 3 has a remainder of 2, the color is Red. o The program should have TWO functions: main - This function is the main routine. It should do the following: Ask the user how many times they want to spin the whell, If the user enters a number less than 4 or greater than 10, the program should continue to ask the user for a valid number between 4 and 10. o Remember you can use a while loop to do input validation. Once the program has a valid number from the user, it should use that number as an argument when calling the spin wheel function. . Rin wheel-This function has one parameter, spins, which is the number of times to spin the wheel. • . . . Use a for loop to spin the wheel the number of times specified. Use the randint function from the random module to get a random digit between 1 and 16 inclusive. Print the number of the loop iteration and the spin value as indicated in the Sample Output. o The number of the loop iteration should start with 1. o The spin value should include the number and either the color of the number or "JACKPOT!" in the case of number 16. After the for loop is complete, print a message thanking the user for playing.
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
-
Consider the randomized block design with one missing value in Table 4-7. Analyze this data by using the exact analysis of the missing value problem discussed in Section 4-1.4. Compare your results...
-
After reviewing this week's learning resources, complete the following for your coding practice lab activity. Textbook Exercises Complete the Exercises in the textbook before moving onto the next...
-
b) Find the minimum spanning tree for the following graph using Kruskal's algorithm. 3 5 7 5 7 3 Does this graph have a unique minimal spanning tree? Justify your answer.
-
Use Lagrange multipliers to find the distance from the point (2, 0, -1) to the plane 6x - 2y + 7z+ 1 = 0. X
-
A thin plate of the shape indicated and of mass m is suspended from two springs as shown. If spring 2 breaks, determine the acceleration at that instant (a) Of point A, (b) Of point B. A thin hoop of...
-
Forces of 225 N and 60 N act on the tooth of a spur gear (Figure P4.8). The forces are perpendicular to one another, but they are inclined by 20 relative to the x-y coordinates. Determine the...
-
Correlation between Residuals and Explanatory Variables. Consider a generic sequence of pairs of numbers \(\left(x_{1}, y_{1} ight), \ldots,\left(x_{n}, y_{n} ight)\) with the correlation coefficient...
-
A statement of financial affairs created for an insolvent corporation that is beginning the process of liquidation discloses the following data (assets are shown at net realizable values): Assets...
-
Crown Brewing issued new shares in 2021 but some investors had not paid their capital\ contribution by December 31st, 2021. Hence, Crown Brewing recognizes a contributed capital\ receivable. No other...
-
A process stream is heated using a shell and tube heat exchanger. The exit temperature is controlled by adjusting the steam control valve shown in figure. During an open-loop experimental test, the...
-
Go to YouTube and search for "Jewish family Passover". View some of the family videos as they apply to how family rituals are taught to the children who are sharing the religious service associated...
-
How do organizations set up a near monetary record, and what reason does a similar accounting report serve?
-
Green LTD has a long-term asset with the following information as of the end of the year: Net book value $ 86,800 Estimated future cash flows $70,000 Fair value $65,000. What is the amount of the...
-
A customer purchased 200 units at $5 each on account and later returns 50 units. The units cost the seller $2 each. What entry (or entries) would the seller make to record the credit to the customer...
-
The US GAAP provides rules and guidance for what two primary financial reporting purposes? Explain each.
-
Ed has a major medical contract that contains a $100 calendar-year deductible. Prior to October of last year, Ed incurred $75 of covered medical expenses. In the last three months of the year, $90 of...
-
Which of the following is an argument against economicintegration? a.It benefits only certain minority groups, not the nation as awhole. b.It results in forced political integration among the...
-
Chao, Louis, and Mari, unrelated individuals, own all of the shares of Cerise Corporation. All three shareholders have been active in the management of Cerise since its inception. In the current...
-
Clorox is the nations leading manufacturer of household liquid bleach (accounting for 49 percent$40 millionof sales annually) and is the only brand sold nationally. Clorox and its next largest...
-
Explain the ethical responsibilities of business.
-
Terminal Grain Corporation brought an action against Glen Freeman, a farmer, to recover damages for breach of an oral contract to deliver grain. According to the company, Freeman orally agreed to two...
-
You are studying survival times for mice given a drug at one of three doses (Low, Medium, or High). You define two dummy variables: (a) With these definitions, write the expressions for the mean...
-
The data in Table 8.25 were collected in order to study factors affecting the supply and demand for commercial air travel. Data on various aspects of commercial air travel for an arbitrarily chosen...
-
It is beneficial to be able to estimate the yield of useful product of a tree based on measurements of the tree taken before it is harvested. Measurements on four such variables were taken on a...
Study smarter with the SolutionInn App