Classes: Final version of Mastermind
At the end of this lab, you will have a complete mastermind game
Learning Objective(s)
- Finish the mastermind game
- End the semester programming on a good note.
Overview of the Program
Finish the mastermind game
Details
- Finish the mastermind game
- The main method should repeat playing a complete game until the user decides to quit.
- The method to play a game should be sent a scanner and continue to get guesses from the user until the user guesses the solution.
- It should use methods to:
- display a menu
- generate a computer "solution"
- get guess a guess from the user
- determine how many are perfect
- determine how many are good (which might use another method)
- It tracks the number of guesses
Sample dialogue
I have the solution. What is your guess?
1 1 1 1 1
On guess 1:
You got 0 perfect.
You got 0 good.
What is your next guess?
2 2 2 2 2
On guess 2:
You got 2 perfect.
You got 0 good.
What is your next guess?
2 2 3 3 3
On guess 3:
You got 0 perfect.
You got 2 good.
What is your next guess?
4 4 2 2 4
On guess 4:
You got 3 perfect.
You got 0 good.
What is your next guess?
4 0 2 2 0
On guess 5:
You got 3 perfect.
You got 2 good.
What is your next guess?
0 4 2 2 0
You guessed it.
Do you want to play again (y or n)? n
Submission
- create an empty zip folder
- place your java file into it
- create a pdf document that contains your Software Development Report for this program and place the pdf file into the zip folder
- submit the zip folder on canvas