![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Nov 2005
Posts: 1
Rep Power: 0
![]() |
programming problem
I am a student in a java programming class. We have to write a program as described below. The teacher is not giving us any help. I don't have a whole lot of programming experience and am not sure what to do. Can anyone explain what the code should look like?
Thanks in advance for any help. ----------------------------------------------------------------------- Write a program to create an Instant Lottery. It cost one dollar to play. A player enters 6 numbers between 1 and 40. After the last number is entered, the computer generates a 6 number winning ticket and compares the player’s numbers to the winning numbers. Payout is according to the following table: Number matched Printed Result 0 Sorry, Better luck next time. 1 Congratulations, you won $1. 2 Congratulations, you won $5. 3 Congratulations, you won $100. 4 Congratulations, you won $1000. 5 Congratulations, you won $10000. 6 Jackpot!!! You won $1 million. Run the game 10 or more times. For each play, print out the player’s numbers, the computer’s numbers, and the results from the table above. At the end, report the total number of games played, the amount wagered, the amount won, and the net gain (won – wagered). |
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|