Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi there I need this in Java! thank you for your help! Mission #13 CS 1400- Hilton a) Basic capability: Write a program that tests
Hi there I need this in Java! thank you for your help!
Mission #13 CS 1400- Hilton 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 progranm 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 Mission #13 CS 1400- Hilton 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 progranm 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 listenerStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started