Design a java program that simulates a slot machine

Assignment Help JAVA Programming
Reference no: EM13713928

Question -A slot machine is a gambling device that the user inserts money into 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, which the slot machine dispenses back to the user. Design a java 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 from the following list: Cherries, Oranges, Plums, Bars, and Bells. The program will select and display a word from this 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 slot machine and the total amount won.

Can you give the answer ASAP and there is no word limit?

Reference no: EM13713928

Questions Cloud

Find the second plain text : Find the second plain text x2 - Can somebody provide the answer for given question with example?
Explain the percent abundance of the heaviest isotope : A hypothetical element has an atomic weight of 48.68 amu. It consists of three isotopes having masses of 47.00 amu, 48.00 amu, and 49.00 amu. The lightest-weight isotope has a natural abundance of 10.0%. What is the percent abundance of the heavie..
How does the marketer''s challenges : Services Marketing thinks of an example of a service in each of the following four categories in Lovelock's classification and answers. How does the marketer's challenges.
Proposal to ensure the application of the concepts : Prepare the Outline of the Final Project based on your approved Project Proposal submitted in Week 4. The Outline must be structured on the Proposal to ensure the application of the concepts and techniques learnt in this module.
Design a java program that simulates a slot machine : Instead of displaying images, the program will randomly select a word from the following list: Cherries, Oranges, Plums, Bars, and Bells. The program will select and display a word from this list three times.
A current passed through a sn(no3)2 solution : A current of 5.63 A is passed through a Sn(NO3)2 solution. How long (in hours) would this current have to be applied to plate out 8.20 g of tin
What role do personality : What role do personality, national culture, and organizational culture play in influencing an individual's ethics
Generate a main program which initializes : Generate a main program which initializes your data array to be sorted - be careful with your array index numbers. You can use a random number generator to generate entries for the array.
Determine the volume of the container after the h2 : At a fixed temperature, equal moles of H2 (g) and O2 (g) are mixed in a constant pressure container (the volume of the container changes in order to keep the pressure at a constant value). The H2 (g) and O2 (g) are allowed to react, producing H2O ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Sequence of method in vector class

Construct a Vector class implementing a number of vector operations as methods along with a testing program to verify the class is working.

  Display random numbers to simulate rolling a die

1. Display random numbers to simulate rolling a die2. Create a java program that simulate a casino game. (rollin a die)

  Wrappershallow and wrapperdeep

Each class is simply a wrapper class to hold a private array variable. int [] a; The default constructor for each class should initialize â??aâ??. Each class should have a toString() and equals(). Each class should have a setArray method that allows ..

  Write a version of sumpairs

Write a version of sumPairs  that sums each component of the pairs separately, returning a pair consisting of the sum of the first components and the sum of the second components. So basically [(3,1)(10,3)] would return (13,4).

  This project is for designing and developing a college

this project is for designing and developing a college registration program. prepare a java program to register

  Design a course registration system

Create an application which represents a simplified course registration system using ArrayLists and HashMaps.

  Creates pet objects from data read from the keyboard

The assignment is to write a program that creates Pet objects from data read from the keyboard. Store these objects into an instance of ArrayList.

  Implements both the quicksort and mergesort algorithms

Write a program that correctly implements both the Quicksort and Mergesort algorithms. The program should generate an array of 500 random numbers in the 1-100 range. The program should sort the same set of numbers and keep time stamps of how long it ..

  Program to translates a number into the closest letter grade

Write a program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade

  Sentence patterns and verb formulas

Provide the sentence pattern. Write out the sentence pattern - then write out the tense of the verb and provide the formula.

  Objectivesto gain experience with arrays to gain

objectivesto gain experience with arrays. to gain experience with generic algorithms.documentationexplain

  1write a program that uses joptionpanes to perform the

1.write a program that uses joptionpanes to perform the following stepsmiddotfirst display a welcome message to your

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd