QuestionQuestion

The Game:
Build a simple game that will allow a player to attempt to guess a randomly generated number from 1 to 10 inclusive.
The player can continue guessing until they get it right.

What your game should do:
1. Your game should remember each choice that the player enters.
2. Each time the player gets the guess wrong tell the player to try again.
3. If the player guesses correctly tell them they were right and also what the number was that they entered.
a. Your game should then print out all the values that the player entered for that game, in the order in which they were entered.
4. The player can then play the game again, but only two more times.

Your program should follow an object-oriented format:
• Your should have two classes in this program:
o The main class
o The class that controls the game.

• Name the class that controls the game - ‘GamePlay.java’.
o This class should include a random number generator, an array/ArrayList that remembers the player’s choices, input from the console (use the Scanner class), and code that starts the game.

• You should modularize your code in the ‘GamePlay’ class; i.e. break it down into methods that do different tasks.
o Your methods and instance variables should be named appropriately and also be defined by the correct modifiers.
o Use print statements via the console to introduce the player to the game and guide him/her through it and show the final results.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

//Bus is another Sub-Class
public class Bus extends Machine {

    // attributes and behaviors unique by subclass
    private int myGearCount;

    public Bus() {
    }

    public Bus(int gearCount) {
       this.myGearCount = gearCount;
    }

    public Bus(String brand, String color, int yearOfMake, int gearCount) {
       super(brand, color, yearOfMake);
       this.myGearCount = gearCount;
    }
   
    // Methods go here

    @Override
    public String toString() {
       return "The brand is: " + myBrand + "\nThe color is: " + myColor + "\nYear of Make is: " + yearOfMake + "\nThere is: " + myGearCount + " gears";
    }...
$20.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats