Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java - Guess The Number

dickersonka
dickersonka 


1) 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). Attachments Tags Clarifications

Answers

Guess The Number

dickersonka
dickersonka 



Guess The Number eclipse java project with comments Attachments
GuessTheNumber.zip (5 K) Download




Preview
- guess ); String direction = " TOO LOW! "; //Check if number is too high or too low if (guess > randomNumber) { direction = " TOO HIGH! "; } //Check if user guessed closer than last time if (currentDifference

Screenshots
Purchase Answer