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

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

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