Answer the subsequent question and also justify your answer with appropriate examples
Question: You have to write a number guessing game in Java. The program should have three difficulty levels, each one having a different maximum number. After the user selects a difficulty, prepare a random number between 1 and X, X being based off of the selected difficulty. The minimum value of the random number should be 1 and the maximum should be X. Then prompt the user for their guess. If they are wrong, tell them they require guessing either higher or lower and making them keep guessing until they guess properly.
The difficulty levels are:
- Easy 1-10
- Normal 1-100
- Hard 1-1000
You can use console input/output or JOptionPane so long as it is consistent and documented
Be sure to include comments. The comment should describe the purpose of the program and the data to be entered.