Skip to content

jenniemeka/randomNumberGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Number Guessing Game

Description

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.

Features

  • 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.

How to Play

  • 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

Why This project

  • 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.

Getting Started

Prerequisites

  • Java Development Kit (JDK) installed.
  • Git (optional, for cloning the repository).

Installation

  1. Clone the repository:

    git clone https://github.com/Jennyemeka/randomNumberGenerator.git
    
  2. Compile the Java Program:

javac randomNumberGenerator/GenerateNumber.java

  1. Run the Program:

java randomNumberGenerator.GenerateNumber

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages