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?
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).
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-
To start, create two java Â±les,
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
row1Â :Â int
row2Â :Â int
row3Â :Â int
+Â playMachine()Â :Â void
+Â isWinner()Â :Â boolean
CS111, Tatiana Harrison, Summer 2017, CWU, HW 1
Page 1 of 3
This question was answered on: Jan 02, 2020Buy this answer for only: $15
This attachment is locked
Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
About this QuestionSTATUS
Jan 02, 2020EXPERT
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).
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.