"> (Answered) Programming Task 1, Chapters 1-7, Review, 30 points We've all heard that the odds in gambling are always in the favor of the casino. But is it true? - Tutorials Prime

Question Details

(Answered) Programming Task 1, Chapters 1-7, Review, 30 points We've all heard that the odds in gambling are always in the favor of the casino. But is it true?


Programming Task 1, Chapters 1-7, Review, 30 points We've all heard that the odds in gambling are always in the favor of the casino. But is it true?


I want to know how to write the two programs' code?Programming Task 1, Chapters 1-7, Review, 30 points

 

We've all heard that the odds in gambling are always in the favor of the casino.

 

But is it true? And what does that mean? For this programming task, you'll apply

 

many of the concepts that you have learned in CS110, to “simulate” playing 1000

 

slot machines, and you'll tally how many of them result in a win.

 

If you are not familiar with slots, they are machines with three or more reels which

 

spin when a button is pushed (Figure 1a). The reels have numbers or pictures of

 

fruits written/drawn on them, and the goal is to have the reels spin, and stop,

 

such that at least one of the 3 visible rows of numbers among the three reels are

 

the same. For this homework problem, you will simulate a slot machine by writing

 

a class, SlotMachine, that has 3 ±elds that are arrays of three integers (Figure 1b).

 

Your class SlotMachine should have a method playMachine, which uses the Ran-

 

dom class to generate random numbers and place them into the three arrays. The

 

method isWinner will determine if any of the three arrays have three identical en-

 

tries (a winning play is shown in ±gure 1c).

 

1

 

5

 

8

 

3

 

3

 

4

 

6

 

8

 

9

 

2

 

4

 

9

 

1

 

5

 

8

 

4

 

4

 

4

 

1a. A slot machine

 

1b. Three arrays repre-

 

senting the three visible

 

rows for three reels

 

1c. Three arrays, the bot-

 

tom of which is a “win-

 

ner.”

 

To start, create two java ±les,

 

SlotMachine.java

 

and

 

Play1000SlotMachines.java

 

, in

 

the IDE of your choice. SlotMachine is the class whose UML diagram is shown be-

 

low. Each of the ±elds row1, row2, and row3 should be an array that contains

 

three integers. The non-default constructor should invoke the playMachine

 

method.

 

SlotMachine

 

-

 

row1 : int[]

 

-

 

row2 : int[]

 

-

 

row3 : int[]

 

+ SlotMachine()

 

+ playMachine() : void

 

+ isWinner() : boolean

 

CS111, Tatiana Harrison, Summer 2017, CWU, HW 1

 

Page 1 of 3

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Jan 02, 2020

EXPERT

Tutor

ANSWER RATING

YES, THIS IS LEGAL

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now
WP2Social Auto Publish Powered By : XYZScripts.com