Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 4 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 14 Sep 2017 My Price 9.00

Lottery class

Image for Exercise 2: Write a Lottery class that simulates a lottery. The class has the following attributes: ? lottery

Show transcribed image text Exercise 2: Write a Lottery class that simulates a lottery. The class has the following attributes: ? lottery Numbers: array of five integers ? user Array: array of five integers ? matches: number of matches and the following methods: ? Constructor: takes in no arguments. It should use the Random class to generate five random numbers in the range of I through 9 and puts them in the lottery Numbers array Note: (int)(Math.randotn()*9+I) generates random numbers in the range 1 through 9. . Method that accepts an array of five integers that represent a person?s lottery picks. Method should compare the corresponding elements in the two arrays and finds the number of matches. For example, the following shows the lottery Numbers array and the user array with sample numbers stored in each. There are two matching digits (numbers 9 and 3). Note that the digits should be in the same position as well. Lottery Numbers array: 7 4 9 1 3 user array: 4 2 9 7 3 . Method print Prize that prints the lottery Numbers array, the user array and the prize. The prize is determined according to the following rules: Grand Prize (SI million): all five digits match $500,000 prize: four out of five match $1000 prize: three out of five match $10 prize: two out of five match $2 prize: one out of five match Sony, nothing for you none out of five match Demonstrate the class in a program that asks the user to enter live numbers. The program should display the lottery Numbers array and the user?s array and the number of digits that match. It should also display a message about the prize. Note: With random numbers, it is really hard to win even a $10 prize.

Answers

(5)
Status NEW Posted 14 Sep 2017 10:09 PM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)