Output the array elements 33 1) 21 30 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 tnut the of the elementa helew, the dieconel

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

use two dimensional array and put comments on what each line of code does

1) Output the array elements
33
21
30
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
(Samplel and Sample2) containing different sample input/output of the program.
Transcribed Image Text:1) Output the array elements 33 21 30 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 (Samplel and Sample2) containing different sample input/output of the program.
PART 2: TwO-DIMENSIONAL ÅRRAY
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
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.
array
elements
Sample Input/Output:
Depicted below are sample outputs when the program is executed (the items in bold
characters are input from the user, while the items in bold italic are generated,
calculated and printed by the program):
Transcribed Image Text:PART 2: TwO-DIMENSIONAL ÅRRAY 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 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. array elements Sample Input/Output: Depicted below are sample outputs when the program is executed (the items in bold characters are input from the user, while the items in bold italic are generated, calculated and printed by the program):
Expert Solution
steps

Step by step

Solved in 4 steps with 2 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