Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

need to make a guessing game in java. the user enters the low valueand high valu

ID: 3617584 • Letter: N

Question

need to make a guessing game in java. the user enters the low valueand high value and program needs to generate a random number inbetween. the user also enters number of guesses they want. the userthan enters their guess and the output must say if they are rightor wrong and how many guesses they have left. if they lose they areasked if they want to play again.
need to use get/set methods and I need at least one constructor. ialso need to include a GameInfo class that will be used to storethe following data during program execution: low and high rangevalues, number of guesses allowed, number of guesses taken, did theplayer win or lose- and i need to write that information in a filein below format:

won:    yes
high : 20
low : 10
alw(number of guesses allowd): 5
tkn(number of guess taken): 3

Explanation / Answer

public class GameInfo {     private int lowValue;     private int highValue;     private int numOfGuesses;     private int selectedNum;     public GameInfo() {         this.lowValue = 0;         this.highValue = 0;         this.numOfGuesses =0;         this.selectedNum =0;     }     public int getHighValue() {         return highValue;     }     public void setHighValue(int highValue) {         this.highValue =highValue;     }     public int getLowValue() {         return lowValue;     }     public void setLowValue(int lowValue) {         this.lowValue =lowValue;     }     public int getNumOfGuesses() {         return numOfGuesses;     }     public void setNumOfGuesses(int numOfGuesses){         this.numOfGuesses =numOfGuesses;     }     public int getSelectedNum() {         return selectedNum;     }     public void setSelectedNum(int selectedNum){         this.selectedNum =selectedNum;     }     public void generateNum()     {         //todo     } }