The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 399 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write a program that simulates a slot machine by asking user to enter amount of money they want to bet. The lowest amount they can bet is $1. simulate spinning the machine by choosing one of these words randomly: Cherries, Oranges, Plums, Bells, Melons, Bars Do this by generating a random number with a value between 0 - 5. Each number corresponds to a string, for example 0 = Cherries, 1 = Oranges and so on. Select a random string 3 times and output the result of the spin. The next thing to do is to determine the result of the spin. The results are based on these rules: If none of the words match, the player loses half their money. If two of the words match, the player doubles their money. If all three match, the player gains 5 times their money. Finally, show the player their total winnings at the end of the round and ask if they want to play again as long as their money is greater than $1. Repeat the spin if they want to play again.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll