Question: A run is a sequence of the same values repeated. Write a program that populates an array of size 20 with the value from die

 A run is a sequence of the same values repeated. Write
a program that populates an array of size 20 with the value
from die tosses. It then prints the array values marking the runs

A run is a sequence of the same values repeated. Write a program that populates an array of size 20 with the value from die tosses. It then prints the array values marking the runs by including them in parentheses as follows: 34(55)6(222)1616(3333)4124 Use the files in the zip file for Assignment 2 as a starting point located at the bottom of the directions. When the program is tested different values will be used from the ptovided test program. Submit the two files: 1. Die SequenceTester.java 2. Sequence.java pont Java.util. Random; This class generates randon die tosses and prints them out, marking "runs", i.e., adjacent repeated values, by including them in parenthesis. For example: 12(55)31243(2222)36(55)31) ublic class Diesequencetester This class marks "runs", 1.e., adjacent repeated values, by including them in parenthesis. For example: 12(55)31243(2222)36(55)631 blic class Sequence private int[] values; private int size; public Sequence(Int capacity) (. values - new int [ capacity ] size 8 public void add(Int value) 1. If (size \& values. Length) f values [size] - value; sizet+; ) 3 + Returns the string of values, with runs enclosed in parentheses. oreturn the string of values with the runs marked, for exaeple 12(55)3.12.43(2222)36(55)63:= public string mariatuns() f

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!