Question: 20 random die tosses in an array (NOT an ArrayList). previous solutions are not working! and please provide a screenshot of ur running solution. [10

 20 random die tosses in an array (NOT an ArrayList). previous

20 random die tosses in an array (NOT an ArrayList). previous solutions are not working! and please provide a screenshot of ur running solution.

[10 points] Problem #4 A run is a sequence of adjacent repeated values. Write a Java class (RunsPrinter.java) with one main method that generates a sequence of 20 random die tosses in an array (and not an ArrayList) and then prints the die values, marking the runs by including them in parentheses, like this: 1 2 (5 5) 3 1 2 4 3 (2 2 2 2) 3 6 (5 5) 6 3 1 Examples of program output 2(33)56(22) (11)(4444)6142(33)1 (55)43(11)53415152153153 1636(11)46312362565345 Make sure that your code compiles and runs without errors when the following commands are used For compilation: For execution: iavac RunsPrinter.iava java RunsPrinter Hint: Use the following pseudocode algorithm: Set a booleanvariable inRun to false For each valid index i in the ArrayList If inRun If values[i] is different from the preceding value Print . inRun false. If not inRun II valuesll 1s the same as the following value Print (. inRun -true. Print values[i] If inRun, print)

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!