The application will ask questions like:
What comes after D?
A child is expected to answer the question and the application will inform the child if the answer is correct or wrong. The application will ask a total of 20 questions. After all 20 questions have been answered, the application will display a score (from 0 to 20) to inform the child how many questions he or she answered correctly. The application will also list all the letters that were asked.
The letters tested are from ‘A’ up to ‘Y’. Do not include the letter ‘Z’. The letters are selected randomly. No letters are to be repeated, that is, each letter is only asked once in the 20 questions.
Note: The java.util.Random class can be used to generate random numbers. For example, the following statements may be used to generate a random number from 0 to 4 inclusive:
Random generator = new Random();
int number = generator.nextInt(5);
PLS HELP ME IN THIS QUESTION
IT USE JAVA AND GUI APPLICATION
ANYWAN WHO HAVE THE SOURCE CODE?
Last edited by James.H; 03-16-2010 at 03:32 PM.
Because this seriously looks like a school task nobody would tend to help if you don't post what you allready have so far. We help, wo don't do homework.
So post us what you've got so far, please.
this is quite an easy project
the thing you should do is put the alphabet in an array
you can get a letter from an array like this:
String test = alphabetArray[0]; //this will put the letter "a" into test
String test = alphabetArray[1]; //will put "b" into test
...
String test = alphabetArray[25]; //will put "z" into test
now you know you can get letters by numbers
like in your first post, you can generate numbers
so if you put the result of your randomgenerator in the veriable randomNumber, you can use that to get a letter from the alphabet
String test = alphabetArray[randomNumber];
I'm not putting the full sourcecode here, but from what I told you should be able to make a start, that is if you're serious about learning Java
A to Y is 25 letters.
Beyond that, what do you have so far? What part of it is confusing?
You can't ask 'what's beyond 'Z' to children. It confuses them![]()
true, but you have to have it in your array, else you can't validate the answer for the letter "Y"![]()
you just have to make sure your random generator doesn't generate the number 25 or higher
okay, you have a good point there![]()
Shaddix ,can u give me the code ,because i really dunno how to write ....i am poor in this subject .so pls guide me thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks