Sponsored Link •

Java Answers Forum
Java lottery program Help needed

4 replies on 1 page. Most recent reply: Dec 27, 2012 8:50 AM by Java Guru

 Welcome Guest   Sign In

 Back to Topic List Reply to this Topic Search Forum Threaded View
 Previous Topic Next Topic
 Flat View: This topic has 4 replies on 1 page
 anil kumar Posts: 1 Nickname: anilraj Registered: Dec, 2006
Java lottery program Help needed Posted: Dec 1, 2006 1:24 AM
 Advertisement
specification
-------------

when the program starts the user should have a choice of placing bets or drawing the lottery numbers.

Placing Bets
-------------

The user is allowed to place any number of bets. Each bet is a 6 different numbers between 1 and 49(inclisive) and costs one pound. Each bet must be accompanied by the user name:there are no tickets in this lottery.The user should also be able to place a 'Lucky Dip' bet in which the program chooses 6 random nmbers for them.

Note:The maximum of 20 bets can be placed before the lottery is drawn.

Drawing lottery numbers
------------------------

The winning numbers will be different numbers between 1 and 49,which are randomly choosen. After the wining numbers are drawn your progream should print the list of people who have won.

The different ways of winning are as follows:

1 correct number 3\$
2 correct numbers 6\$
3 correct numbers 25\$
4 correct numbers 750\$
5 correct numbers 50000\$
6 correct numbers 5000000\$

After the winners names and amounts have been printed the program should print the amoubt of loss/profit the lottery has made.The loss/profit is the difference between the amount of money taken in bets and the amount of money paid out in winnings

Tips:
-----

The numbers for the bets should be stored in 2 dimensional array.

 Matthias Neumair Posts: 660 Nickname: neumi Registered: Sep, 2003
Re: Java lottery program Help needed Posted: Dec 7, 2006 2:22 AM
We don't do homework here.

Just two hints:

If "any number of bets" should be possible, arrays make your life harder. In that case it would be better to use an ArrayList<int[]> object (if you use JDK1.5 or higher).

Make sure that when getting random numbers, no number is generated twice in one round.

 Perrin Aybara Posts: 1 Nickname: perrin Registered: Dec, 2006
Re: Java lottery program Help needed Posted: Dec 19, 2006 11:22 PM
Anil,
What sort of help you needed?

 kiruthika senthiladevi Posts: 1 Nickname: deepamadhe Registered: Jan, 2007
Re: Java lottery program Help needed Posted: Jan 6, 2007 4:17 PM
hi anil even i hav tha same course work
did u finish it

 Java Guru Posts: 1 Nickname: marts78 Registered: Dec, 2012
Re: Java lottery program Help needed Posted: Dec 27, 2012 8:50 AM
Hi,

Did you ever complete your java lottery assignment? I have this same assignment which I'm really struggling with :(

Thanks.

 Flat View: This topic has 4 replies on 1 page
 Previous Topic Next Topic

 Sponsored Links

 Web Artima.com

Copyright © 1996-2018 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use