Cs 1400 - hilton - write a program that tests the users


Mission

a) Basic capability:

Write a program that tests the user's ability to memorize a random sequence of colors. As shown in the sample session, the program starts off by displaying a JOptionPane dialog box with a list of colors that are to be memorized - red, white, yellow, green, and blue.

The user then uses a form you create to enter the colors one at a time into a text box. If the user guesses the color correctly, the text box is cleared and the user is asked to enter the next color. If the user makes a mistake, the program prints a "Sorry" message. If the user correctly enters all five colors correctly, the program prints a "Congratulations" message. Note that when the sorry or congratulations message is printed, the window's original components get cleared away, so that the user cannot enter any more text.

As always, you are required to write elegant code. In particular, you should avoid hard coding the color values in the interior of your program. You should declare those values one time in an array at the top of the program.

Note:
- Your program should contain a class named MemoryGame.
- Use a simple FlowLayout layout manager scheme.
- Use an inner class for the listener.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Cs 1400 - hilton - write a program that tests the users
Reference No:- TGS02382560

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)