The randomNumberGenerator is a simple Java program that generates a random number and allows the user to guess the number. It provides feedback on whether the guessed number is too high, too low, or correct. The user has a limited number of attempts to guess the correct number.
- Generates a random number.
- User input to guess the number.
- Provides feedback on the guessed number (too high, too low, or correct).
- Limited attempts for the user to guess the correct number.
- Run the program.
- Enter a random number to guess.
- You have a maximum of 5 attempts to guess the correct number.
- The program will provide feedback on whether the guessed number is too high, too low, or correct.
- If you guess the correct number within the allowed attempts, you win. Otherwise, the game will notify you that you have exceeded your guesses
-
If Statements: As a beginner, this project exposed me to the versatile use of if statements in programming. I learned how to structure conditional logic for decision-making in my code.
-
Random Class: I gained insights into utilizing the Random class for generating random numbers. This feature added an element of unpredictability to the program, enhancing the user experience.
-
Error Handling: The project taught me how to implement error handling mechanisms. I explored techniques for catching errors and personalizing error messages, improving the overall robustness of my code.
-
Scanner Class: I delved into the usage of the Scanner class for interactive user input. This experience allowed me to create a more dynamic and engaging user interface for the random number guessing game.
- Java Development Kit (JDK) installed.
- Git (optional, for cloning the repository).
-
Clone the repository:
git clone https://github.com/Jennyemeka/randomNumberGenerator.git
-
Compile the Java Program:
javac randomNumberGenerator/GenerateNumber.java
- Run the Program:
java randomNumberGenerator.GenerateNumber
This project is licensed under the MIT License.