Write a program Guess.java to play a guessing game with the user. The program should randomly generate an integer between 1 and 100, then ask the user to try to guess the number. If the user guesses incorrectly, the program should ask them to try again until the guess is correct; when the guess is correct, the program should print a congratulatory message. If the guess is wrong, the program says whether it is too high or too low. Your program should count how many guesses it takes the user to get the number, and print this number at the end with the congratulatory message. Coding standards: On each project assignment, you must include introductory comments at the beginning of your file indicating the name of the file, purpose of the application (a brief description), your name and your instructor's name. For example, the HelloWord.java contains all the proper introductory comments that are expected in the class MyInFo that your will develop for this project (saved in the file MyInfo.java):
/* File Name: HelloWorld.java
*
* Purpose: Greeting the World.
*
* Name: your name goes here
*
* Instructor: Your instructor's name goes here
*/
public class HelloWorld
{
// display the message hello World... on the screen
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Note: This java code is an example to illustrate how to use introductory comments
in a java class, it is NOT the code that you must submit for this project.
Deliverables:
Guess.java