Sponsors: Michael Fertik - Best JAVA Web hosting Company & 30% off


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-16-2010, 07:28 AM
Member
 
Join Date: Mar 2010
Posts: 4
Rep Power: 0
funjoke is on a distinguished road
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);
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 03-16-2010, 11:41 AM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 8,431
Rep Power: 11
Fubarable is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-20-2010, 05:46 AM
Member
 
Join Date: Mar 2010
Posts: 4
Rep Power: 0
funjoke is on a distinguished road
Default gui and java
but i dun have any idea to start coding .can guide me ?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 03-20-2010, 10:12 AM
Senior Member
 
Join Date: Mar 2010
Posts: 605
Rep Power: 1
gcalvin is on a distinguished road
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-
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 03-29-2010, 03:00 PM
Member
 
Join Date: Mar 2010
Posts: 4
Rep Power: 0
funjoke is on a distinguished road
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:
File Type: txt alphabet.txt (1.6 KB, 5 views)
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 04-09-2010, 11:36 AM
j2me64's Avatar
Senior Member
 
Join Date: Sep 2009
Location: Zurich, Switzerland
Posts: 484
Rep Power: 2
j2me64 is on a distinguished road
Default
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.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


Java Forums is supported by the best jsp hosting.

All times are GMT +2. The time now is 05:58 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org