public abstract class Final { private int row; private int column; public int(][] table; public Final(int r, int c) { row =r; column = e; table = new int[row][column]; public void hi(){ System.out.println("hi"); public abstract void fillTable(): public abstract int[][] tranformTable();// if table elements greater than or equal to the “key" value, replace I/ them with “1", otherwise replace with “0" /* for example, if table has following elements and the key=5: 10 2 3 45 6 3 8 1 Your method should return: 10 0 0 1 1 010 public abstract int countOneTable(int[][] table); // returns total number of “1" in the transformed table } // end of the Final class Write a class that uses the Final 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 "Final" class. * For invalid input, you should throw exceptions. */

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
public abstract class Final {
private int row;
private int column;
public int[][] table;
public Final(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[][] tranformTable();// 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
6.
8.
Your method should return:
1 0 0
0 1 1
0 1 0
3
1
*/
public abstract int countOneTable(int[][] table); // returns total number of "1" in the transformed table
} // end of the Final class
/*
* Write a class that uses the Final abstract class defined above.
* The class should fill the table with random numbers between "O" 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 "Final" class.
* For invalid input, you should throw exceptions. */
Transcribed Image Text:public abstract class Final { private int row; private int column; public int[][] table; public Final(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[][] tranformTable();// 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 6. 8. Your method should return: 1 0 0 0 1 1 0 1 0 3 1 */ public abstract int countOneTable(int[][] table); // returns total number of "1" in the transformed table } // end of the Final class /* * Write a class that uses the Final abstract class defined above. * The class should fill the table with random numbers between "O" 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 "Final" class. * For invalid input, you should throw exceptions. */
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY