Tests the user''s ability to memorize a sequence of colors

Assignment Help Operating System
Reference no: EM13944693

The files must be called <YourNameProg7.java>.

Ensure you include ALL files required to make your program compile and run.
I would like to see your .java files only.

Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter.

Basic Requirements

Write a program that tests the user's ability to memorize a sequence of colors. As shown in the sample session, the program starts off by displaying a dialog box with a list of colors that are to be memorized - red, white, yellow, green, and blue. The user then enters the colors one at a time in a text box. If the user makes a mistake, the program prints a "Sorry" message. If the user correctly enters all the colors, the program prints a "Congratulations" message. Note that when the sorry or congratulations message is printed, the window's original components get cleared away.

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 YourNameProg7.

-Use a simple FlowLayout layout manager scheme.

-Use an inner class for the listener.

As always:

Limit your use of class variables and instance variables - use them only if appropriate.

Use appropriate modifiers for your methods. The modifiers we've discussed are private, public, static, and final.

Use helping methods if appropriate.

Mimic the sample session precisely. In particular, note the dialog box's text, the window's title, and the window's text.

First sample session:

The opening dialog box:

After closing the dialog box, here's the main window:

After typing the first color:

After pressing enter and then typing the second color:

After entering all five colors correctly:

Second sample session:

After closing the dialog box and typing the first color:

After pressing enter and then typing the second color:

After pressing enter:

You can get full credit for completing this section only.

Extra Credit

Provide a hint button that causes the current color's first letter to appear in the text box. For example, since the first color is red, the first hint should be r. The hint button must cause focus to be put on the text box (i.e., the cursor should appear within the text box without the user having to click there with the mouse). To cause focus to be put on a component, use the requestFocusInWindow method. See Sun's API documentation for requestFocusInWindow details.

Sample session:

After closing the dialog box, here's the main window:

After clicking the hint button:

After typing the first color:

After pressing enter and clicking the hint button:

After entering all five colors correctly:

Attachment:- ProgrammingProblem7.doc

Reference no: EM13944693

Questions Cloud

Probability of getting an average : Assume grades in a course follow a normal distribution. The average grade in a class is 75, and the standard deviation is 5 points. A professor takes a sample of 10 people in the class and calculates the average for that class is also 75. IN other..
Who is silenced or forgotten in your school curriculum : Who is silenced or forgotten in your school curriculum as a result of these decisions or policies?
Probability a randomly selected service call cost : Service calls for major repairs are more expensive. Sixty percent of service calls for major repairs cost the customer $300 or more. What is the probability that a randomly selected service call cost $300 or more?
What do you think rene descartes philosophy on being : Descartes is careful to explain the "Cogito," or "I think, therefore, I am," and exactly what is meant by this claim. He discusses if he can be sure about being awake versus being asleep. Descartes thinks that he can be sure. What do you think?
Tests the user''s ability to memorize a sequence of colors : Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter.
Analysis of clinical decision making : Suggested assignment: An analysis of clinical decision making Guidance: students are to identify and record an anonymised patient care decision and produce a chronological transcript of this.
Issue accountant face when switching to manufacturing system : To begin, read the article The Lowdown on Lean Accounting and describe some of the issues accountants face when switching to a lean manufacturing system
Determine the test statistic : (a) Determine the test statistic. Show all work; writing the correct test statistic, without supporting work, will receive no credit.(b) Determine the P-value for this test. Show all work; writing the correct P-value, without  supporting work, wi..
Confidence interval for a population proportion : A 95% confidence interval for a population proportion yielded the interval (.678, .764). Show your work. 1. Compute the margin of error.

Reviews

Write a Review

Operating System Questions & Answers

  Configuration management

Determine which is more applicable across the widest possible range of situations: process modeling or configuration management. Be sure to explain your rationale.

  Discuss a profitable business function

Risk Evaluation Record relates to the decided on information system. A good information system is actually a small grouping of calculating in addition to circle components that will discuss a profitable business function, under frequent control in..

  Phase 1the premise of project 2 is to create your own shell

phase 1the premise of project 2 is to create your own shell. your shell will be launchable from a terminal window and

  When would we overwrite bob''s database, and with what

Suppose we are using Lamport's hash, and Bob's system crashes before receiving Alice's reply to a message. Further suppose an intruder, Trudy, can eavesdrop and detect that Bob crashed (maybe Trudy can even cause Bob to crash).

  Solving networking question

Your corporation has a network that contains many NetWare 4.11 servers and uses IPX as the routing protocol. Each of network sections has at least one NetWare server on it.

  Potential security threats to managing information

Suppose that you have been asked to consult for a corporation that has branch offices in four continents. You have implemented a management data system that will enable its managers to exchange information.

  Process customer order history from a file

Required help creating a document that Develop an application that will read and procedure customer history order information from a document.

  Question about affiliate programs

Many companies are using affiliate programs to drive traffic to their Web sites. explain what an affiliate program is and how it works.

  When a customer buys an item from the store

When a customer buys an item (or several) from the store, several changes to database tables will occur. Explain what those might be.

  Modify the payroll program application

Modify the Payroll Program application so it continues to request employee information until the user enters stop as the employee name

  Dedicated microprocessor for inputting multiple 8-bit unsign

Design a dedicated microprocessor for inputting multiple 8-bit unsigned numbers until a zero is entered. Then output the number of numbers entered. First design the datapath and write the control words for it. Clearly label all control signals. Th..

  Discuss mitigation strategies

It is determined that 3-out of 5-businesses that experience downtime of forty-eight hours or more will be out of business within three years.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd