Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Could someone please help me with this? The code should be written in Java. Assignment 4 tests your knowledge of Decisions Structures in Java (Chapter
Could someone please help me with this? The code should be written in Java.
Assignment 4 tests your knowledge of Decisions Structures in Java (Chapter 4). For the assignment you are going to write a program that simulates the rolling of dice and create a simple dice rolling game using concepts learned in class so far (Chapter 1 to 4)1 First, write a class called YourNameDice (the class file/project/package should be called YourNameDice; replace YourName with your actual name) that simulates a single dice 2. The YourNameDice class should have the following fields and methods (with these exact names and caps): Once you have designed the class, design a program/driver class (file YourNameAssignment4; replace YourName with your actual name) that has the following functionality of the main method: 1. Create three objects of the Dice class called: Dicel created using the no parameter constructor, Dice 2 using the parameterized constructor for parameter 1, and Dice3 using the parameterized constructor with parameter 3 . 2. Set the value for Dice2 to 6 using the SetValue method. 3. Output the values for Dice1, Dice2, and Dice 3 in all 3 ways: a. output the dice number using the OutputDiceValue method, b. output the dice name using the OutputDiceName method, and c. output the dice drawing using the OutputDiceDrawing method. 4. Get the 3 dice values using the Getvalue accessor/getter methods, add up the 3 dice values into a variable called NumberPoints and output a message informing the user that they earned NumberPoints from the rolling of the 3 dice
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started