Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 20th, 2005, 10:24 PM   #1
mcl1008
Newbie
 
Join Date: Nov 2005
Posts: 1
Rep Power: 0 mcl1008 is on a distinguished road
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).
mcl1008 is offline  
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:04 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC