Homework

Homework Questions? Ask a Tutor for Answers ASAP

Ask an Expert,
Get an Answer ASAP!

Homework
This answer was rated:

Develop a Java application that plays a "guess the number"

game as described below. a) Your...
Develop a Java application that plays a "guess the number" game as described below.

a) Your application first gets a random number in the range 1-1000 inclusive (you might want to use Math.random() or the Random class).

b) The application then displays the following prompt (probably via a JLabel):
I have a number between 1 and 1000. Can you guess my number?
Please enter your first guess.
Post a textbox for the user to enter a number and post a message telling the user to hit 'Enter' after entering a guess in a textbox (probably using a JTextField).

c) Input the user's guess in the code for a previously-registered event-handler method (consider using the event-handling approach discussed in the text, or the actionPerformed() method of class based on the ActionListener interface, which will require some additional research outside the text).

d) For the first guess, color the entire background red, meaning that they are getting warmer (you might want to use the setBackground() method for a container). If this is the second or later guess, and they are further from the correct number than the last guess, then color the entire background blue. If they get the correct number then color the background some other color than red or blue.

e) If the user guessed the number correctly, respond with their number, post a congratulatory message, get a new random number, and display a JButton to start a new game. Otherwise, to help the user close in on the correct number, post a message, with their guessed number, whether they are "TOO HIGH" or "TOO LOW" from the correct number, and whether they are "WARMER" or "COLDER" (this should match the background color). Also report the guess number of the next guess (e.g. "Enter guess number nnn"). You might want to use a concatenated string in JLabel for these incorrect guess messages.

f) The process is repeated each game until the user guesses the correct number. Be sure that you erase obsolete status messages.

You must run your program for a scenario where the number is XXXXX guessed correctly for at least 4 (four) tries (it can be more). A game where you guess the correct number on the fourth try is acceptable. You must show all user inputs and program outputs for this scenario, not just a sample.

Your submitted output must include the appropriate red or blue background after each guess.

You must include at least one "warmer" and one "cooler" result.

To help you visualize what is required for this program please review the sample output from the last step in these specifications below.

(This program was taken from Exercise 11.15 on page 592 of Deitel & Deitel's "Java How to Program (Sixth Edition)" (2005 by Pearson Publishing Co.))

Be sure that you include the course, the program number, your name, and the date in your program header. Include additional comments as necessary and maintain consistent indentation for good programming style as shown in the text. Be sure that you capture all of your output for this program's execution for full credit!
Show More
Show Less
Ask Your Own Homework Question
Answered in 2 hours by:
6/16/2013
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,240
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified
Hi,
Welcome back
My name is XXXXX XXXXX I will help you.
What is the deadline?
Ask Your Own Homework Question
Customer reply replied 4 years ago

12 midnight MST today


 

THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,240
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified
LogicPro and 87 other Homework Specialists are ready to help you
Ask your own question now
Ask LogicPro Your Own Question
LogicPro
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,240
13,240 Satisfied Customers
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML

LogicPro is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

LogicPro

LogicPro

Engineer

13,240 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,549 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,635 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,158 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
Presentation geared toward teaching a younger person (age
Presentation geared toward teaching a younger person (age 9-14) about Judaism. Your presentation must contain at least 10 slides and include speaker's notes that describe what you would say if you wer… read more
lani_s
lani_s
Bachelor\u0027s Degree
47 satisfied customers
I cannot get started with this assignment in my DBM 381
I cannot get started with this assignment in my DBM 381 class … read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,158 satisfied customers
Need a biography on a important leader during the civil war.
Need a biography on a important leader during the civil war. I have chosen Stonewall Jackson. I need a title page, two sources at least one from a book, sources need to be cited under MLA format, work… read more
eth1819
eth1819
Bachelor's Degree
118 satisfied customers
I am conducting two surveys and trying to figure out how
Hello,I am conducting two surveys and trying to figure out how many responses I need in order for the findings to be significant or generalizable. I sent surveys out to two different populations.Popul… read more
GLENN
GLENN
Master of Mathematics
330 satisfied customers
BusinessTutor: HELP ME. I need you to do the problem solved.
BusinessTutor: HELP ME. I need you to do the problem solved. Look below: http://www.mediafire.com/?ojdihu5x6eyofne http://www.mediafire.com/?aeb9wdeb2o374yl (problems questions & answers) Its due asap… read more
Manal Elkhoshkhany
Manal Elkhoshkhany
Tutor
Foundation classes for MBA
4,549 satisfied customers
Smallest unit of matter that has all the properties of an element
Please help I only have one hour: 1. Which of the following is the smallest unit of matter that has all the properties of an element? (Points: 4) molecule element atom compound electron 2. Isotopes of… read more
Bizhelp
Bizhelp
CPA
Bachelor's Degree
1,887 satisfied customers
Historical Example of Labor Supply and Demand Submit a 250-
Historical Example of Labor Supply and Demand Submit a 250- to 300-word response addressing one of the following historical events in terms of labor supply and demand: the Great Depression, the Luddit… read more
Joanne
Joanne
Bachelor\u0027s Degree
252 satisfied customers
A low pass filter has the following specifications:
A low pass filter has the following specifications: Fp=2.4MHz Lp=3dB Fs=6MHz Ls=40dB 1. Determine the required order of a Butterworth filter that meets the above specifications.… read more
Ashok Kumar
Ashok Kumar
Master\u0027s Degree
291 satisfied customers
HEALTH, SAFETY, AND NUTRITION FOR THE CHILD 605844RR -
HEALTH, SAFETY, AND NUTRITION FOR THE YOUNG CHILD 605844RR - Preventing Illness and Injuries When you have completed your exam and reviewed your answers, click Submit Exam. Answers will not be recorde… read more
GLENN
GLENN
Master of Mathematics
330 satisfied customers
Random variable is normally distributed with a mean
Random variable is normally distributed with a mean of μ = 50 and a standard deviation of σ = 5. What is the probability the random variable will assume a value between 45 and 55 (to 4 decimals)? What… read more
R.R. Jha
R.R. Jha
Bachelor\u0027s Degree
150 satisfied customers
I need the following flowchart for Car Class in MS Word. The
I need the following flowchart for Car Class in MS Word … read more
Dr. Donna Kakonge
Dr. Donna Kakonge
Doctor of Education
193 satisfied customers
FOR Discussion Question 1 • Due Date: Day 2 [post to the
FOR ANGELA Discussion Question 1 • Due Date: Day 2 [post to the Main forum] • Post your response to this question: Consider the statement “psychology has a long past but a short history.” What do you … read more
Seanna
Seanna
Tutor
1,781 satisfied customers
When I open a word document it has a character string 20 and
When I open a word document it has a character string 20 and places that character after I type each line. This is just a recent problem and. How can have work not insert that character?… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,158 satisfied customers
I need help regarding javascript with custom objects and
I need help regarding javascript with custom objects and constructors. I am having trouble calling an onclick function in a form to an array.… read more
LogicPro
LogicPro
Engineer
13,240 satisfied customers
Fiscal restraint is defined as: a. Tax hikes or spending
Fiscal restraint is defined as: a. Tax hikes or spending cuts intended to reduce aggregate demand. b. Tax hikes or spending cuts intended to increase aggregate demand. c. Tax cuts or spending hikes in… read more
Chris M.
Chris M.
M.S.W. Social Work
Master's Degree
2,635 satisfied customers
Explain the types purpose and function of materials and
Explain the types purpose and function of materials and equipment needed for the administration of medication via the different routes … read more
Dr. Donna Kakonge
Dr. Donna Kakonge
Doctor of Education
193 satisfied customers
I have a couple of basic java questions i need answered.
I have a couple of basic java questions i need answered … read more
LogicPro
LogicPro
Engineer
13,240 satisfied customers
This week you'll be making the following refinements to the
This week you'll be making the following refinements to the class that you wrote in the last assignment. All the requirements from that class are still in force. For example, all MyStrings must always… read more
LogicPro
LogicPro
Engineer
13,240 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x