The Artima Developer Community
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

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  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
Reply to this message Reply
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
Reply to this message Reply
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
Reply to this message Reply
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
Reply to this message Reply
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
Reply to this message Reply
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
Topic: Graal VM and its setup Previous Topic   Next Topic Topic: [TIJ4] Dining Philosophers problem.

Sponsored Links



Google
  Web Artima.com   

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