Question
i need a java code for this question .. This is what i have so far please help. We are suppose to use objects in
i need a java code for this question .. This is what i have so far please help. We are suppose to use objects in this assignment.
//import scanner class import java.util.Scanner; //import random class import java.util.Random; //import Array class import java.util.Arrays;
//public class Yahtzee { //main method public static void main(String[] args){ //initialize int variable for the dice int dice = 5; //set it equal to 5 (there are 5 dice) //create an instance of the Random class (random numbers are from 1-6) Random randomNum = new Random(); //create an instance of the Scanner class Scanner sc = new Scanner(System.in); //create an array holding 5 values int [] new_Array=new int[dice]; //--First Roll-- //for loop for (int i=0; i }
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