Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

am bar Tid . . pleena Werfect Implement the above UML diagram in java, . As a instance variable, there is a 2d array called

image text in transcribed
image text in transcribed
image text in transcribed
am bar Tid . . pleena Werfect Implement the above UML diagram in java, . As a instance variable, there is a 2d array called arrayd" . In the constructor 2 points.get the row and column number, initialize the array accordingly - Using the nilArray methodi2 points add random elements to this ad array (use 0-10 range The getColumn methode points), returns a 1d array back containing the elements of the given column in arrayed in the same order as they appear in this array2d. Make sure that the given column is valid for array2d, Equivalent method 8 points) returns true only if every value in first array(first argument for this method) appears in the second array (second argument for this method), hasDuplicates methods points) returns true if there are any duplicate values in the given array, false otherwise, - Perfect method (10 pointsy returns true if array2d is a perfect array Ad array is perfect if: the first row has no duplicates all the first row elements also appear in each row of this array too all the first row elements also appear in each column of this array too - Make sure that the given 2d array has equal number of rows and columes and has at least one row Example Make sure that the given 2d array has equal number of rows and columns a Example: Int 10 array2d = {{1,2,3), {4,5,6), {7,8,9}} array2d.getColumn(2) should return (2,5,8) Examples of perfect array: {{1,2,3} {2,3,1},{3,1,2}} {{10,20,30,40},{40,30,20,10},{30,40,10,20},{20,10,40,30}} Examples of non-perfect array: . {{1,2,1),(2,1,1),(1,1,2}} {{1,2},{1,2}) {{1,2,3),(3,1,2},{4,5,6} } . - DOO Implement the above UML diagram in java. As a instance variable, there is a 2d array called "array2d" In the constructor points). get the row and column number, initialize the array accordingly. . Using the fillArray method 2 points, add random elements to this 2d array (use 0-10 range). . The getColumn methode points returns a 1d array back containing the elements of the given column in array2d in the same order as they appear in this array2d. Make sure that the given column is valid for array2d Equivalent method a points returns true only If every value in first array(first argument for this method appears in the second array (second argument for this method) hasDuplicates methods points) returns true if there are any duplicate values in the given array, false otherwise. - sPerfect method (10 points) returns true if array2d is a perfect array Ad array is perfect it - the first row has no duplicates - all the first row elements also appear in each row of this array too all the first row elements also appear in each column of this array too - Make sure that the given 2d array has equal number of rows and columns and has at least one row

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What is the impact of not doing that?

Answered: 1 week ago