Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a class that simulates a growable 2D integer array withthe following prope

ID: 3607887 • Letter: W

Question

Write a class that simulates a growable 2D integer array withthe following properties: a.)GrowableIntArray(int rows,int cols) constructor takes therow size and col size of the array as the input,and initializes the2D array. b.)The no arg. constructor just creates aGrowableIntArrayObject without initializing the 2D array. c.)addElement(int value, int r, int c) takes 3 input, thevalue to be added to the array, the row position and the columnposition to be added.If the given position exceeds the row size orthe column size, the array should be enlarged in the relatedposition(column or row size should be changed accordingly) so thatthe new element can be added to the position given without loosingany value given before. d.)changeRowSize(int row,int size) method changes the size ofa given row to the given size.The previous values that fits intothe new given size are protected,the ones at the positions out ofbounds are lost.So, you should write the followingmethods assuming that the 2Darray is a ragged array because it is possible makethe array ragged.) Write a class that simulates a growable 2D integer array withthe following properties: a.)GrowableIntArray(int rows,int cols) constructor takes therow size and col size of the array as the input,and initializes the2D array. b.)The no arg. constructor just creates aGrowableIntArrayObject without initializing the 2D array. c.)addElement(int value, int r, int c) takes 3 input, thevalue to be added to the array, the row position and the columnposition to be added.If the given position exceeds the row size orthe column size, the array should be enlarged in the relatedposition(column or row size should be changed accordingly) so thatthe new element can be added to the position given without loosingany value given before. d.)changeRowSize(int row,int size) method changes the size ofa given row to the given size.The previous values that fits intothe new given size are protected,the ones at the positions out ofbounds are lost.So, you should write the followingmethods assuming that the 2Darray is a ragged array because it is possible makethe array ragged.)

Explanation / Answer

//Here isthe GrowableIntArray class with ragged array that will growwith the input elementindex. //Hope this will helpyou.. //Don't forget to rate it.
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote