Question: Hello, I need help with coding, our teacher is asking us to create a code in Notepad ++ using java for the following. This is

Hello, I need help with coding, our teacher is asking us to create a code in Notepad ++ using java for the following. This is the 3rd activity of 3 for this project, let me know if there is any confusion.

Create a Die (single dice) class. This class will be instantiated as a Die object in the main() method of your program four times to represent four dice, which plays the game. In your class definition, create:

int value (to represent the current value of the Die)

a constructor method (called to create a Die in main())

a roll() method, which is a mutator method that changes the value of the Die

a getValue() method, which is an accessor method, that returns the value of the Die to main()

Using this Die class that you define, instantiate it four times by creating four Die objects in your main() method for game execution.

Provide a functionality that allows the computer to play on its own without user prompting. The user inputs a number that is the number of times the computer should play the game on its own, and when s/he pushes the button, the computer plays the game that many times. After playing, the computer should output the final results of all of the games. You can also output the win or loss after each game - your choice. After being displayed the welcome message from activity 2, display instructions to the end user as to enter a "1" or a "2." The user can enter "1" to play the game manually, or enter "2" to have the computer play on its own. If the user inputs "1" the manual, single should execute. If the user inputs "2" the user inputs a number that is the number of times the computer should play the game on its own, and then the computers plays the game that many times - outputting the results of each game and a tally at the end of the number of total wins and the number of total losses. The game should, in either mode, allow the end user to play again.

You can add any additional static methods you like to better organize your source code, but I only require the welcome(String name) method to be defined, and for it to be called for execution in the main() method.

It is refering to a Dice Game that we must make/follow the rules for, here are the following rules/expectations of the overall project:

This is a dice game (each roll uses four die = 4 dice) that you are going to create in the command line console. The rules are as follows:

A new player begins with his first dice roll (4 die = 1 set of dice). This is known as the "starting roll."

If the player rolls a 6, 12, 18, or 24 the player wins.

If the player rolls a 9, 11, 17, 19, or 23 the player loses.

If the player rolls any other number, the "starting roll" becomes the "goal number."The player must continue to roll the dice until either one of two things happens:

The player rolls a 11, and he loses.

The player rolls the "goal number" again, and he wins.

ANY HELP would be greatly appreciated and any answer will be positively rated adn thumbed up! Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!