Hamza K.

asked • 06/27/21

java programming language please help ASAP

public abstract class Resit {


private int row;


private int column;


public int[ ][ ] table;


public Resit(int r, int c) {


row = r;


column = c;


table = new int[row][column];


}


public void hi() {


System.out.println("hi");


}


public abstract void fillTable();


public abstract int[][] transformTable();// if table elements greater than or equal to the “key” value, replace


// them with “1”, otherwise replace with “0”


/*for example, if table has following elements and the key=5:


10 2 3


4 5 6


3 8 1


Your method should return:


1 0 0


0 1 1


0 1 0


*/


public abstract int countOneTable(int[][] table); // returns total number of “1” in the transformed table


} // end of the Resit class


/*


* Write a class that uses the Resit abstract class defined above.


* The class should fill the table with random numbers between “0” and “upper bound” value.


* So, the class should have properties to hold the “upper bound” value and the “key”.


* Implement your class constructor considering (it means your constructor must get the upper bound value and the key) all cases and test all methods given in the “Resit” class.


* For invalid input, you should throw exceptions. */

1 Expert Answer

By:

Patrick B. answered • 06/27/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.