Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 listener

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

Question Can life insurance be used in a Keogh (HR 10) plan?

Answered: 1 week ago