Write a class called PowerBall that simulates the Power Ball lottery game.

Completed Posted Jan 19, 2014 Paid on delivery
Completed Paid on delivery

Write a class called PowerBall that simulates the Power Ball lottery game. The class should have an array of integers representing the 5 winning picks for the white balls numbered 1 to 59 (no duplicates), an integer representing the winning power ball number numbered 1 to 35, and an integer that specifies the jackpot for the game. Your PowerBall class should have the following constructor / methods:

public PowerBall(int jackpot) {}

public int getWinningPowerBall() {…}

public int [] getWinningNumbers() {…}

public int getPayout(int[] picks, int pb) {…}

public String toString() {…}

Create a program called PowerBallConsole that includes a main method to test your PowerBall implementation. Your PowerBallConsole class should create a new PowerBall instance and ask the user to enter their 5 picks plus a power ball number. The console should display the winning numbers, the power ball, and the player’s cash payout. Use the following table to determine the payout:

Powerball match only $4

1 number plus PB match $4

2 numbers plus PB match $7

3 numbers; no PB match $7

3 numbers plus PB match $100

4 numbers; no PB match $100

4 numbers plus PB match $10,000

5 numbers; no PB match $1,000,000

5 numbers plus PB match Jackpot

Java JavaScript

Project ID: #5338249

About the project

2 proposals Remote project Active Jan 19, 2014

Awarded to:

tapsitiwari

Hi, I can implement the class easily for you. Please message me so that we can finalize & I can start with the implementation. regards Tapsi

$30 USD in 1 day
(6 Reviews)
2.9

2 freelancers are bidding on average $30 for this job

XFastSolution

Dear sir, With expertise in Java and familiar to PowerBall, I would be a good fit. I can put my best effort to complete it today. Kind regards, LY

$30 USD in 1 day
(5 Reviews)
2.7