It Skill Report
It Skill Report
VIDYALAYA
DODDABALLAPURA
IT SKILL
Project
Session : 2024-2025
A Project Report On
“Guess the Number Game”
Submitted by BALAJI V
Class – XII (Science) Under the Guidance of
Mr. SUKHATEERTHA
PGT (Computer
Science)
Table of Contents
Signature of Principal
Mr.R.CHAKRAVARTHY
Acknowledgement
I would like to express a deep sense of thanks and gratitude to my project guide
Mr. SUKHATEERTHA for guiding me immensely through the course of the
project. He always evinced keen interest in my project. His constructive advice
& constant motivation have been responsible for the successful completion of
his project.
I must thank my classmates for their timely help and support for completion of
this project.
Last but not the least, I would like to thank all those who had helped directly or
indirectly towards the completion of this project.
BALAJI V
Class- XII (Science)
Guess the Number Game in Java
1. Game Concept
● Logical thinking: Players need to refine their guesses based on the feedback
(high/low).
● Instant feedback: After every guess, the program provides feedback, guiding the
player closer to the correct answer.
● Tracking progress: The number of attempts is recorded and displayed when the
correct guess is made.
The random number is generated by using the Random class from Java’s standard
library. This number serves as the target for the player to guess.
The Scanner class is used to collect user input. After each guess, the program
compares the player's guess to the random number and provides feedback
accordingly.
The game continues until the player guesses correctly. After the correct guess, the number of
attempts is displayed.
int numberOfTries = 0;
while (playerGuess != numberToGuess) {
numberOfTries++;
}
You could add multiple difficulty levels to adjust the range of the random number. For
example:
You could limit the number of guesses to make the game more challenging. For
instance, you could restrict the player to 10 tries.
After the player guesses correctly, offer them a chance to play again without
restarting the program. This can be achieved by wrapping the game logic in a
loop.
For a more advanced version, you could add a graphical user interface (GUI) using
JavaFX or Swing. A GUI could include buttons for submitting guesses, labels for
displaying feedback, and a more interactive experience.
4.1 Challenges
● Handling Incorrect Inputs: The current code assumes the player will always
enter a valid integer. Additional validation for non-integer inputs or invalid
guesses (e.g., negative numbers) could be added to improve the game.
● Game Logic Flow: While this implementation is simple, more complex games
would require additional state management (e.g., maintaining multiple levels or
storing game progress).
5. Conclusion