2. Produce a class in java which creates two dimensional arrays A, B and C. Array A contains 9 elements, array B contains 4 elements and array C contains 4 elements. Write and execute a java program to perform following operations by creating object of the above class, and using it to do the following operations: Input: Take input (nonzero numbers) from user and store elements in the array A(3 X 3) and array B(2 X 2) Display: Display elements in the array A and Array B Find_common: Create and display array C (2 X 2) that contains those elements that are common to array A and array B, otherwise display 0 Note: Above operations are to be implemented as methods of class for array 1 2 3 4 5 6 7 8 5 18 5 23 9 9 9 A(Input) B (Input) C (Output)

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter10: Object-oriented Programming
Section: Chapter Questions
Problem 20RQ
icon
Related questions
Question
2. Produce a class in java which creates two dimensional arrays A, B and C. Array A contains 9 elements,
array B contains 4 elements and array C contains 4 elements.
Write and execute a java program to perform following operations by creating object of the above
class, and using it to do the following operations:
Input: Take input (nonzero numbers) from user and store elements in the array A(3 X 3) and
array B(2 X 2)
Display: Display elements in the array A and Array B
Find_common: Create and display array C (2 X 2) that contains those elements that are common
to array A and array B, otherwise display 0
Note: Above operations are to be implemented as methods of class for array
1 2 3
4 5 6
7 8
5
18
5
23
9
9
9
A(Input)
B (Input)
C (Output)
Transcribed Image Text:2. Produce a class in java which creates two dimensional arrays A, B and C. Array A contains 9 elements, array B contains 4 elements and array C contains 4 elements. Write and execute a java program to perform following operations by creating object of the above class, and using it to do the following operations: Input: Take input (nonzero numbers) from user and store elements in the array A(3 X 3) and array B(2 X 2) Display: Display elements in the array A and Array B Find_common: Create and display array C (2 X 2) that contains those elements that are common to array A and array B, otherwise display 0 Note: Above operations are to be implemented as methods of class for array 1 2 3 4 5 6 7 8 5 18 5 23 9 9 9 A(Input) B (Input) C (Output)
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage