Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a java program that generates elements (randomly from 10-75) of a 2-dimensional array (5x5) using the Random Class then perform the following: 1)
Create a java program that generates elements (randomly from 10-75) of a 2-dimensional array (5x5) using the Random Class then perform the following: 1) Output the array elements 2) Output the sum of prime numbers in the array 3) Output the elements in the main diagonal. 4) Output the sum of the elements below the diagonal. 5) Output the sum of the elements above the diagonal. 6) Output the odd numbers below the diagonal. 7) Output the even numbers above the diagonal. 1) Output the array elements 21 30 33 45 32 50 10 50 35 42 25 12 35 12 11 45 14 50 28 21 15 41 15 19 41 2) Output the sum of prime numbers in the array. 112 3) Output the elements in the main diagonal. 21 10 35 28 41 4) Output the sum of the elements below the diagonal. 286 5) Output the sum of the elements above the diagonal. 311 6) Output the odd numbers below the diagonal. 25 45 15 41 19 7) Output the even numbers above the diagonal. 30 32 50 42 12 Required: The java file (FamilyName_2Dim.java) containing the code and 2 image files (Sample) and Sample2) containing different sample input/output of the program. Create a java program that generates elements (randomly from 10-75) of a 2-dimensional array (5x5) using the Random Class then perform the following: 1) Output the array elements 2) Output the sum of prime numbers in the array 3) Output the elements in the main diagonal. 4) Output the sum of the elements below the diagonal. 5) Output the sum of the elements above the diagonal. 6) Output the odd numbers below the diagonal. 7) Output the even numbers above the diagonal. 1) Output the array elements 21 30 33 45 32 50 10 50 35 42 25 12 35 12 11 45 14 50 28 21 15 41 15 19 41 2) Output the sum of prime numbers in the array. 112 3) Output the elements in the main diagonal. 21 10 35 28 41 4) Output the sum of the elements below the diagonal. 286 5) Output the sum of the elements above the diagonal. 311 6) Output the odd numbers below the diagonal. 25 45 15 41 19 7) Output the even numbers above the diagonal. 30 32 50 42 12 Required: The java file (FamilyName_2Dim.java) containing the code and 2 image files (Sample) and Sample2) containing different sample input/output of the program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
import javautilRandom public class FamilyName2Dim public static void mainString args int array new i...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started