Design a java program that simulates a slot machine

Assignment Help JAVA Programming
Reference no: EM13163852

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, Bells, Melons, Bars 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. 

Reference no: EM13163852

Questions Cloud

Write an essay on your communication in your team : Analyse each team member's team contribution, including yourself, using the ‘Five simple rules for being an effective team member' to guide your comments. Provide specific examples to support your viewpoint.
Prevent from the loss of confidentiality caused by malware? : 1. Cybercirminals can use malware to steal files and information from computer, if this happens have loss of confidentiality. Explain how antivirus can be help to prevent from the loss of confidentiality caused by malware?
Implementation for the r-type instructions add, or, and and : figuring out how to add an implementation for the R-type instructions ADD, OR, and AND. This is a MIPS architecture. // Incomplete behavioral model of MIPS pipeline
What is the order of the public key? : the weaknesses that arise in Elgamal encryption if a public key of small order is used. We look at the following example. Assume Bob uses the group Z ? 29 with the primitive element ?= 2. His public key is ?= 28.
Design a java program that simulates a slot machine : 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 random..
Characteristics of quicksort : familiarize  with the performance characteristics of Quicksort under normal and worst case conditions. The assignment will require some programming and interpretation of the results.
What is the total amount paid by the corporation : A U.S. corporation has purchased currency call options to hedge a 70,000 pound payable. The premium is $.02 and the exercise price of the option is $.50. If the spot rate at the time of maturity is $.65, what is the total amount paid by the corporati..
Display the dfs starting from a specified vertex : Design and implement a driver to show the following (check for 2 graphs; 1 is provided, including the starting vertex):Display the dfs starting from a specified vertex;Display the discovery/finishing time for each node in the graph;Show the Parenthes..
Client class to test implementation of the vector class : Write a client class to test your implementation of the Vector3D class thatyou implemented. Name the package in which this class is defined (projectname) vector3dapp.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a project in eclipse

Create a new project

  Java program use breadth-first search closest broadcast

Write the java program which will use breadth-first search (which you implement as part of your program) to determine the closest broadcast vertex for each vertex in graph.

  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

  Write a void function this passed three integers

1. Write a void function this passed three integers by reference. The function should rearrange the parameter values so that the first parameter will get the smallest value; the second parameter the middle value; and the third parameter the largest v..

  World data app

Prepare WorldDataApp project. It implements the NameIndex portion, including creating it in SetupProgram, and searching, viewing and updating it in UserApp program.

  Create a recursive factorial program

Assignment 1: Create a recursive factorial program that prompts the user for an integer  N  and writes out a series of equations representing the calculation of  N !. For example, if the input is 4, the output could be:

  Java program which demonstrates cellular automata

Using the internet, locate a Java program (or Java applet) which demonstrates "Cellular Automata", in particular "the Game of Life".

  Implement security so that all users can view the informatio

Implement security so that all users can view the information about the projects, but only authenticated users

  Write a java program that accepts a positive long integer

Write a Java program that accepts a positive long integer between 2 to 15, and then using the number, calculate its factorial (n!). Using do-while statement, make sure it only accepts a valid number (between 2 and 15) - if an invalid number is ent..

  Method named isallvowels that returns

Write a method named isAllVowels that returns whether a String consists entirely of vowels (a, e, i, o, or u, case-insensitively). If every character of the String is a vowel, your method should return true. If any character of the String is a non-vo..

  Pass in the number of gallons on board

public float usefulLoad() // this is the grossWeight - emptyWeight public float usefulLoadWithFuel( in gallons ) // this is the useful load - gallons x 6. The programmer user will pass in the number of gallons on board.

  Programming exercises

Programming Exercises 1. Write an application named BadSubscriptCaught in which you declare an array of 10 first names. Write a try block in which you prompt the user for an integer and display the name in the requested position.

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