First, you have to understand: the method AddRowAtTheBack. These methods will also be in the class CoordinateRow.
The first 2 steps will be the same, in short:
- make a class Coordinate
- initialize an array and the numberOfElements
new:
2. method add Row in The Front
If you want to add row:
In front of coordinateArray:
The method addRowInFront has to do the following:
this is an example, the value of the elements are just random.
In java code language you will use this code (sketch):
if you work out the sketch:
Like we did in the method addRowAtTheBack, we used our knowledge about objects to get the numberOfElements and the values of the elements. (row.numberOfElements and row.coordinateArray[i])