Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment: Gambling 1 of 2 cation that simulates a gambling slot machine. In the application, perform the 1: 1. Prompt the player to enter

image text in transcribed

Assignment: Gambling 1 of 2 cation that simulates a gambling slot machine. In the application, perform the 1: 1. Prompt the player to enter the amount of money that the player is willing to gamble. 2. Create three random numbers in range from one to four to represent three of the following four objects (Apple, Orange, Cherry and Pineapple). 3. Compare the numbers for equality and calculates the prize. o If all three numbers are the same, the player wins three times the amount inserted. If two objects are the same the player wins back the amount inserted (gets the money back), otherwise the player wins $0. 4. Display the randomly selected objects (fruits names, not integers). Use switch or if else statements to examine the randomly created integers in order to display the corresponding fruits. 5. Display the dollar amount that the player wins. 6. Here is an example what the program should do: Enter the dollar amount inserted into the slot machine: 100 Orange Apple Cherry Sorry, you lost Or Or Enter the dollar amount inserted into the slot machine: 100 Orange Cherry Cherry Congratulations, you won $ 100 Enter the dollar amount inserted into the slot machine: 100 Orange Orange Orange Congratulations, you won $300

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions