Results 1 to 6 of 6
  1. #1
    funjoke is offline Member
    Join Date
    Mar 2010
    Posts
    4
    Rep Power
    0

    Default Write a graphical user interface (GUI) application to be used to test Kindergarten ch

    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);

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Thanks for posting your homework assignment in the forum. I'm sure that I speak for all when I wish you much luck with it. Please let us know if your submission is successful and please do come back with your best attempt and a specific question if you run into any problems.

  3. #3
    funjoke is offline Member
    Join Date
    Mar 2010
    Posts
    4
    Rep Power
    0

    Default gui and java

    but i dun have any idea to start coding .can guide me ?

  4. #4
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Certainly by now you have seen some Java programs. You probably have some in your textbook or other materials that work similarly to the program you want to write.

    Sometimes it's good to think in terms of Input, Output, Storage, and Computation (since these are the four basic things a computer can do).

    What kind of Input do I need to get? Where will I get it from? How?

    What kind of Output will I be generating? How will I present it to the user?

    What kind of data does my program need to store? How will I structure that data? What names will I give to my data structures?

    How will my program act on the data it needs to receive and store? What methods do I need to write?

    Once you have answered those questions, you can start working on some little piece of the problem. It doesn't really matter where you start, but when you're learning a language, it often helps to start with Input and Output, since you can at least see what is going on. Storage and Computation tend to be a little more abstract.

    Think about those things, and see if that helps you get started. Please do come back and show us what you've got so far. (Remember to use CODE tags when you post your code.)

    -Gary-

  5. #5
    funjoke is offline Member
    Join Date
    Mar 2010
    Posts
    4
    Rep Power
    0

    Default gui application to test kindergarden character

    i have some error when test this code ,that is the question request that one alphabet exist one time only during 20 question .but mine de got repeated alphabet ,how 2 solve it ? code as below
    Attached Files Attached Files

  6. #6
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by funjoke View Post
    but mine de got repeated alphabet ,how 2 solve it ? code as below

    use askedLetterIndex = (int)(Math.random()*25);

    you should not go till the last char because alphabet[askedLetterIndex + 1] == answer will throw and out of bounds exception if the last index is in askedLetterIndex.

Similar Threads

  1. Multiple views on user interface application
    By dand_dd in forum SWT / JFace
    Replies: 36
    Last Post: 04-24-2009, 09:05 AM
  2. User Interface
    By swikar.java in forum Advanced Java
    Replies: 16
    Last Post: 12-09-2008, 02:37 PM
  3. How to write a Main to test this...
    By Zombie_Leg! in forum New To Java
    Replies: 9
    Last Post: 09-27-2008, 02:30 PM
  4. user interface development using JSP
    By pradeep1_mca@yahoo.com in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 06-02-2008, 01:48 PM
  5. Help user interface
    By carl in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 07:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •