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

已完成 已发布的 Jan 19, 2014 货到付款
已完成 货到付款

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

项目ID: #5338249

关于项目

2个方案 远程项目 活跃的Jan 19, 2014

授予:

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 在1天内
(6条评论)
2.9

有2名威客正在参与此工作的竞标,均价$30/小时

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

$30USD 在1天里
(5条评论)
2.7