Implement a simple number guessing game using html forms

Assignment Help JAVA Programming
Reference no: EM13804968

Your assignment is to implement a simple number guessing game using HTML forms and a Java servlet. The HTML page should introduce the game and provide a form for the user to guess a number on. The servlet should use an HTTP session object to store all session specific data. If the session object is empty, the servlet will need to generate initial values for all session specific data items. Session specific data will include the number to be guessed and the number of guesses so far.

The servlet should return an HTML form indicating whether the guess was high, low, or correct. The form should also indicate how many guesses so far, and allow the user to enter another guess. If a user's guess is closer to the target than the user's previous guess, set the background of the form to red. If a user's guess is farther from the target than the user's previous guess, set the background of the form to blue. This will require additional session specific data to be stored.

When the user has guessed correctly, the servlet should reset all the session specific data, the form should have a background color other than red or blue, and it should invite the user to start playing a new game.

Reference no: EM13804968

Questions Cloud

In a regression equationwhat is y hat : In a regression equation, what is y hat
What is the equivalent amount of new income : A company is considering getting involved in electronic commerce. A modest e-commerce package is available for $29,000. If the company wants to recover cost in 2 years, what is the equivalent amount of new income that must be received every 6 months ..
Write a term paper about world civilizations 3500bc-1600ad : Write a term paper about World Civilizations, 3500BC-1600AD.
Down payment plus equal monthly payments : A car is financed as follows: $2,000 as down payment plus equal monthly payments at 8% annual interest rate compounded monthly for 3 years. Original price of the car was $12,500. It is expected that maintenance costs are going to be $700 in the first..
Implement a simple number guessing game using html forms : Your assignment is to implement a simple number guessing game using HTML forms and a Java servlet. The HTML page should introduce the game and provide a form for the user to guess a number on. The servlet should use an HTTP session object to store..
Calculate the test statistic for the test part b. : A claim is made that p=0.60 Set up the null and alternative hypothesis to test this claim.
Write an essay fix about rome : Write an essay fix about Rome.
Discuss goal setting methods or strategies : Discuss goal setting methods or strategies that you have used in the past. How do they compare to the SMART method? Which is most effective for you, and why?
Discrepancies that arise in cognitive accounting : Consumers' choices are prey to subtle discrepancies that arise in cognitive accounting. Learning how and when you are prey to these discrepancies is an important step in improving your decision-making.

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Write a program called word guessing game.

Write a program called Word Guessing Game. Open the file FourLetterWords.txt and write the contents into an array of Strings (the file has 87 words in it).

  Define get and set functions and two constructors

Create a class called Building. It will have one data member of type string (used for a postal address). Define get and set functions and two constructors.

  Write a program that creates a two-dimensional array

Write a program that creates a two-dimensional (2D) array initialized with test data (for instance, use Random method to prepare an array of integers).

  Ood methodology

Your local police department wants to design new software to keep track of people, property, and criminal activity. List at least three classes you think should be in the design. For each class, identify some data members and methods.

  Write a simple program that uses the class

Write a simple program that uses the class. It should prompt the user to input a string, display it, call one or the other of the class functions to convert it, then display the converted string.

  Functional abstraction

Question 1: What are some of the benefits of modularity? Question 2: What is functional abstraction? Question 3: What is information hiding?

  Specify, design, and implement a class

Specify, design, and implement a class that can be used in a program that simulates a combination lock. The lock has a circular knob with the numbers 0 through 39 marked on the edge, and it has a three-number combination, which we will call x,y,z.

  Write a script that simulates a casino machine

Write a script that simulates a casino machine. To play a single round on the machine user pays $ 5. Now when the user start the machine, the machine rolls a pair of dice

  Write a method called add uneven arrays

Write a method called addUnevenArrays that takes two arrays, a and b, and returns a new array, c, with alength that is the maximum of the lengths of a and b. Each c[i] is the sum of the corresponding elementsof a and b if both elements exist.

  Consider a class that could be used to play a game of

consider a class that could be used to play a game of hangman. the class has the following attributesthe secret wordthe

  Write applet which reads five numbers-draw equivalent stars

Write the applet which reads five numbers (each between 1 and 30). For each number read, your program must design line containing that number of adjacent asterisks.

  Modify the java application using java netbeans ide

Modify the Java application using Java NetBeans IDE to meet these additional and changed business requirements. The application will now compare the total annual compensation of at least two salespersons.

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