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

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

Umiejętności: Java, JavaScript

Zobacz więcej: string c plus plus, int power, c plus plus string, c plus plus array, java console, jackpot, power power, javascript write display, 100 balls game, 100 balls, write java program game, javascript power, numbers array program, write program simulates lottery program array, lottery method, lottery number, jackpot program program, javascript lottery, create lottery, javascript console game, jackpot game, java lottery, lottery lottery method, java game ball, lottery program

O pracodawcy:
( 3 ocen ) Wilson, United States

Numer ID Projektu: #5338249

Przyznany użytkownikowi:


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 w 1 dzień
(6 ocen)

2 freelancerów złożyło ofertę na kwotę $30 do tego projektu


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 w ciągu 1 dnia
(5 Oceny)