Project 2. 🎯 Number Guessing Game – Beginner Console Project

 Introduction


Learning Java becomes much easier when you build small, practical projects. One of the best beginner-friendly projects is a Number Guessing Game.

This project helps you understand:

  • Loops
  • Conditional statements
  • User input using Scanner
  • Random number generation

In this blog, we’ll build a console-based Java Number Guessing Game where the player gets 5 chances to guess the correct number.



🧠 How the Game Work


1. The computer generates a random number between 1 and 100.

2. The user is asked to guess the number.

3. After each guess, the program tells whether the guess is

    Too High

    Too Low

4. The user has only 5 attempts.

5. If the user guesses correctly within 5 attempts → πŸŽ‰ Win

6. Otherwise → ❌ Game Over



πŸ› ️ Tools & Concepts Used


1. Java

2. Scanner (for user input)

3. Random (for random number generation)

4. while loop

5. if-else conditions



πŸ§ͺ  Output






πŸ’» Java Source Code


https://github.com/architnishad/OIBSIP/blob/5cf4c0afd2324b52bbe0c6884407e24f97c6727b/1.%20Number%20Guessing%20Game

Comments

Popular posts from this blog

Project 1. 🏧 ATM Interface Project in Java (Console-Based)