Search:

Type: Posts; User: helloworld922

Search: Search took 0.11 seconds.

  1. Replies
    12
    Views
    6,654

    Re: lucky draw.. (pls help)

    Hmm, well instead of generating luck-draw numbers, you can generate random indices, and add that to the list of winners. Then you just need to make sure you don't pick the same person to be the...
  2. Replies
    12
    Views
    6,654

    Re: lucky draw.. (pls help)

    You have to compare each random number with every contestant.


    for (int i = 0; i < winningNum.length; i++)
    {
    for (int j = 0; j < luckyDrawNumber.length; j++)
    {
    if (winningNum[i] ==...
  3. Replies
    12
    Views
    6,654

    Re: lucky draw.. (pls help)

    Please don't make multiple posts with the same question...

    Since you said you're not allowed to use other objects, use a for loop:


    for (int i = 0; i < id.length;i++)
    {
    ...
  4. Replies
    12
    Views
    6,654

    Re: lucky draw.. (pls help)

    1st question: are you allowed to create other classes? That would make this task a lot easier.


    public class Contestant
    {
    String id;
    String name;
    String phoneNo;
    String...
Results 1 to 4 of 4