Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# A slot machine is a gambling device into which the user inserts money and then pulls a lever (or presses a button). The slot

C# A slot machine is a gambling device into which the user inserts money and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user. Design a program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Instead of displaying images, the program will randomly select a word fron the following list : Cherries Oranges, Plums, Bananas, Melons, Pineapples

The program will select and display a word from the list three times. If none of the randomly selected words match, the program will inform the user that he or she has won $0. If two of the words match, the program will inform the user that he or she has won two times the amount entered. If three of the words match, the program will inform the user that he or she has won three times the amount entered. The program will ask whether the user wants to play again. If so, these steps are repeated. If not, the program displays the total amount of money entered into the solt machine and the total amount won. Design a string function that will accept an integer and return a string containing the associated fruits name. Design a checkprize function that accepts 3 ints and returns the multiplier (0, 2, or 3) that corresponds to the prize that should be given. C# please.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

=+j Describe an effective crisis management program.

Answered: 1 week ago