Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the Java classes (with full details of all felds and methods, including constructors and getter, setter methods) which are required to simulate the following

Implement the Java classes (with full details of all felds and methods, including constructors and getter, setter methods) which are required to simulate the following problem: A casino has 10 Fruit Machines that customers are using to play. A fruit machine is a machine in which a player (customer) inserts a coin (worth of 1 pound) every time to play a single game. Following the insertion of a coin, the machine displays to the customer exactly 3 random fruits next to each other (each fruit is chosen randomly from a total of 21 fruits, see below for the details of the probabilities of how the fruits are chosen). If during a single game the machine displays to the player 2 fruits which are the same, the player is credited with 20 pounds. If during a single game the machine displays to the player all 3 fruits which are the same the player, is credited with 100 pounds in their account. The customer (player) has a name, address, lives in a city (which might be diferent than that of the casino), a casino balance (credit) which is the money available to play and has a favourite casino with a specifc name. A casino has a location (city) and can accommodate up to 100 customers at the same time. A Fruit machine holds a number of coins (it is assumed that 1 coin is worth 1 pound). Each fruit machine displays 2 fruits of the same kind with probability 10%, if the credit in the machine (number of coins) is greater than 300. (if the credit is less than that, the fuit will never display 2 fruits which are the same). A fruit machine displays 3 fruits of the same kind with probability 2%, if the credit in the machine is greater than 500 (if the credit is less than that, the fuit will never display 3 fruits which are the same). If the credit in the machine is less than 300 then always the fruit machine displays 3 unique fruits. As part of your implementation, in addition to the classes described in the scenario above, you should also provide a Simulation class in which a player interacts with a fruitmachine and plays 100 games with it. You do not need to include getters and setters for every single feld. Assuming that you implement the constructor of a class to initialise the felds, you could just provide getters and setters for 1 or 2 felds only.

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago