can anyone help, i want to write an APPLET that plays the "guess the number" game as follows: the program chooses the number to be guessed at by selecting a random integer in the range 1 to 1000. The applet displays the prompt 'Guess a number between 1 and 1000' next to a JTextField. The player types a first guess into the JTextField and presses the Enter key. If the player's guess is incorrect, your program should display "Too high. Try again" or "Too low. Try again" in the status bar to help the player 'zero in' on the correct answer and should clear the JtextField so the user can enter the next guess. When the player enters the correct answer, display one of the following messages, depending on how many attempts the player took to get the answer right: If the number of guesses was fewer than 10, print "Congratulations. You guessed the number in n guesses - either you know the secret or got lucky!" where n is the actual number of attempts taken. If the number of guesses was exactly 10, print "Congratulations. You guessed the number in 10 guesses". If the player takes more than 10 guesses, print "You took n guesses. You should be able to do better!" again, where n is the actual number of attempts taken.
once the application is working, i want to modify it to allow the player to enter their first name and the number range to use (e.g., 1 - 100, 20 - 2000, etc...) Change the output to display the player's name as well as the appropriate output message. i aslo need to Calculate the number of guesses that a player should take to find the random number given the inputted range, and use this value, rather than 10, when deciding which of the three final output messages to display when the player successfully guesses the random number. so if anyone knows this coding, PLEASE PLEASE PLEASE SHOW ME. i am new at this and frankly books r no help at all to me, thank you
You can find source for things like this through google. If you still need help .. I'd be happy to get you going. I might be wrong, but the Dietel dudes <grin> had a C++ book with the same type of problem and how to solve it (no applet of course) and I think their Java book is the same format. That might be another place to look.
The same game comes along with tomcat server JSP examples.Install tomcat server and go to its homepage(http://localhost:8080/index.html)-- then go to JSP Examples link, there you'll get numberguess example.