Answered step by step
Verified Expert Solution
Question
1 Approved Answer
or presses a buttonl. The slot machine then displays a ser of random images. If two oe mure of the images match, the user wiss
or presses a buttonl. The slot machine then displays a ser of random images. If two oe mure of the images match, the user wiss atn amount of money that the sot machise dspenses Create a program that simulates a slo machine. When the peogram euts, it should do Asks the user so enter the amoust of mosey he or she wants to enr ino the sor machine. hack to the LseT the folluwing: * Instead of displaying imagn, the pro am will randomly select a word from the following Ist Cheries, Ohanges, Plsms, Bells, Melons, as To selct a word, the program cas penerate a random number in the ranpe of O through 5. If the number is 0, the iclected word is Cherning if the number is I, the sekected word is Oranges and ss farth. The progam should randoml sclect a woed from this st three rimes and display all three of the woerds. If none of the randomly sekcted words match, the peogran will inform the uscr that he oe she has won 50. If rwo of rhe wurds matuh, the peogram will infoem the seer that he or she has wos two rmes the amoune ennered.If three of the woedk manch, the progran will isform the user thar he or she has won three times the anount ennered The progran will ask whether the user wants to pla again. If so, chese steps ace repeated. If no, the progrom dsplays the total amount of mones enoceed ineo the sloe machine and she total acount won Decision Structures
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started