Instruction: Create a java program that generates elements (randomly from 10 – 75) of a 2-dimensional arra (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. Below is an example when the program is executed. 1) Output the array elements 21 30 33 45 32 50 25 45 15 10 12 14 50 35 50 15 35 12 42 11 28 21 41 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

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
Note: Please make a java program code using "for loop", "while loop", or "do-while loop". Please make sure that I will see the codes, not a blank space like the second picture. Thank you.
Vas this wolution
hebul?
Transcribed Image Text:Vas this wolution hebul?
Instruction:
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.
Below is an example when the program is executed.
1) Output the array elements
33
21
30
45
32
42
50
25
10
12
35
12
28
50
35
50
11
45
14
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
Transcribed Image Text:Instruction: 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. Below is an example when the program is executed. 1) Output the array elements 33 21 30 45 32 42 50 25 10 12 35 12 28 50 35 50 11 45 14 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
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
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