insta_hista
New Member
- Joined
- Nov 9, 2017
- Messages
- 2
Can somebody please help me code the following question? I don't know where to begin and desperately need help. If somebody could help me code this I will be so very appreciative.
A coffee shop is giving away a prize by selling coffee cups with a letter placed under each cup’s rim. To win the prize, you must collect cups with letters that spell the name, HORVATH. In production, letters are randomly selected and placed under the rims of the cups. Create a program that does the following:
(a) Animates the selection of cup letters. Keeps selecting coffee cups until all seven of the necessary letters have been collected and displays the number of cups purchased in order to win the prize. (Letters should be randomly and independently selected from the alphabet when inserted under the rims of the coffee cups.)
(b) Performs this simulation several times (without the animation) to determine, on the average, how many coffee cups need to be bought in order to win the prize. Your program should prompt the user to provide the number of simulation runs required.
(c) How much would the prize need to be worth in order to play the game without losing money on all the cups of coffee purchased? (Assume that each coffee costs $1.00.) Note: You can determine this via the coding from (b) and then have your program write the result on your spreadsheet.
A coffee shop is giving away a prize by selling coffee cups with a letter placed under each cup’s rim. To win the prize, you must collect cups with letters that spell the name, HORVATH. In production, letters are randomly selected and placed under the rims of the cups. Create a program that does the following:
(a) Animates the selection of cup letters. Keeps selecting coffee cups until all seven of the necessary letters have been collected and displays the number of cups purchased in order to win the prize. (Letters should be randomly and independently selected from the alphabet when inserted under the rims of the coffee cups.)
(b) Performs this simulation several times (without the animation) to determine, on the average, how many coffee cups need to be bought in order to win the prize. Your program should prompt the user to provide the number of simulation runs required.
(c) How much would the prize need to be worth in order to play the game without losing money on all the cups of coffee purchased? (Assume that each coffee costs $1.00.) Note: You can determine this via the coding from (b) and then have your program write the result on your spreadsheet.