gamer1127
August 17th, 2009, 07:43 PM
Hello.
I am creating a simple program that will allow the user to enter 6 random numbers then after that a Random() class will generate 6 random numbers then verify if the random numbers generated matches the numbers entered by the user. It's like a computeruzed version of a lottery system.
Now, I'm thinking of storing the numbers that the user has entered in an array and the random numbers generated by the Random() class in another array, then use the two arrays to check if the numbers match or not.
I created a class for the numbers entered by the user and his other information e.g name, age. Then I also created a class for the random number generator.
Now, I just want to know how will i store the numbers entered by the user and the random numbers into the array? Also how will i force the random class to just generate up to 6 numbers and keep it from generating the same number again? May I know how will I declare the two arrays in the class?
I am creating a simple program that will allow the user to enter 6 random numbers then after that a Random() class will generate 6 random numbers then verify if the random numbers generated matches the numbers entered by the user. It's like a computeruzed version of a lottery system.
Now, I'm thinking of storing the numbers that the user has entered in an array and the random numbers generated by the Random() class in another array, then use the two arrays to check if the numbers match or not.
I created a class for the numbers entered by the user and his other information e.g name, age. Then I also created a class for the random number generator.
Now, I just want to know how will i store the numbers entered by the user and the random numbers into the array? Also how will i force the random class to just generate up to 6 numbers and keep it from generating the same number again? May I know how will I declare the two arrays in the class?