Question: Notice the already-defined instance data, row, an array of int values. Do not add any instance data to the class. Overloaded constructor (2nd one in

  1. Notice the already-defined instance data, row, an array of int values. Do not add any instance data to the class.
  2. Overloaded constructor (2nd one in code skeleton) which initializes the array to a random set of 0s and 1s. Array is of the provided size (passed in as parameter).
  3. Complete the default constructor (1st one in code skeleton) which initializes the array to a random set of 0s and 1s with a default array size of 5.
  4. Complete the last overloaded constructor (3rd in code skeleton) which initializes the instance data array to the array passed as a parameter.
  5. The toString() method is already defined.
  6. Write a method getRowClues() which returns a String counting the number of sequential 1s.

package rowcluesproject;

public class PuzzleRow { private int[] row; public PuzzleRow () { } public PuzzleRow (int size) {

} public PuzzleRow (int[] row) {

} public String toString() { String result = ""; for (int i=0; i

}

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!