Hello, I need Java class written for the below project. 1st I will list the inst
ID: 638930 • Letter: H
Question
Hello, I need Java class written for the below project. 1st I will list the instructions then I will list the driver for the project. Please comment if you have any questions:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
INSTRUCTIONS:
Objective:
Write a class called HiLowGame which is used by the driver to play a high risk game of hi low! In this game, the player is presented with a number and they must guess if the next mystery number is higher or lower. If they guess correctly they are awarded points and continue. If they don
Explanation / Answer
import java.util.*;
// The class HiLowGame needs to have the following:
class HiLowGame{
// Instance Variables
// numberQueue which is a queue of type Integer.
private Queue<Integer> numberQueue;
// points which is a whole number
private int points;
// currNumber which is the current number to base whether or not the next one in the array list will be higher or lower
private int currNumber;
public static final int MIN_ARRAY_LIST_SIZE = 10;
public static final int MAX_RANDOM_NUMBER = 100;
// Constructor
// A default constructor that initializes points to be 0 and also constructs the numberQueue. HINT!!! To set up the numberQueue use the following
public HiLowGame(){
numberQueue = new LinkedList<Integer>();
points = 0;
}
public Queue<Integer> getNumberQueue() { return numberQueue; }
public int getPoints() { return points; }
public int getCurrNumber() { return currNumber; }
public void setPoints(int k) { points = k; }
// Accessors and Mutators for all the instance variables.
// resetQueue
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.