Create a java program that generates elements (randomly from 10-75) of a 2-dimensional array (5x5) using...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
import javautilRandom public class FamilyName2Dim public static void mainString args int array new i... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
Let r and s be solutions to the quadratic equation x 2 b x + c = 0. For n N, define d0 = 0 d1 = r s dn = b dn1 c dn2 (n 2) Prove that dn = r n s n for all n N. [4 marks] (b) Recall that a commutative...
-
Aggie, inc. purchased a truck at a cost of $12,000. the truck has an estimate salvage value of $2,000 and an estimated life of 5 years, or 100,000 hours of operation. The truck was purchased on...
-
Under what conditions would the payback and discounted payback period methods produce identical results?
-
a. As we noted, Assar Lindbeck once said that short of aerial bombardment, rent control is the best way to destroy a city. What do you think Lindbeck might mean by this? b. How does paying key money...
-
The price of a stock share (no dividend, current price is 50) follows a GBM with drift 12% and volatility 35%; the continuously compounded risk free rate is 5%. Consider a (European-style) lookback...
-
Controlling inventory is one of Wheeled Coachs toughest problems. Operating according to strategy of mass customization and responsiveness, management knows that success is dependent on tight...
-
SunTex Limited reported the following information for August: Direct materials $125,000 Direct labor 80,000 Manufacturing overhead 40,000 Beginning work-in-process inventory 50,000 Ending...
-
Make a standard critical thinking type question from "The importance of being Earnest "
-
Where should both the gross amount of receivables and the allowance for expected credit losses be reported?
-
Nash Company follows the practice of pricing its inventory at LCNRV, on an individual-item basis. Cost Estimated Selling Cost to Complete Item No. Quantity per Unit Price and Sell 1320 1,400 $3.26...
-
Project L requires an initial outlay at t=0 of $40,000, its expected cash inflows are $12,000 per year for 9 years, and its WACC is 13%. What is the project's MIRR? Do not round intermediate...
-
In the law, a _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ is an event sufficiently related to a legally recognizable injury to be held to be the cause of that injury. license warranty proximate cause duty
-
ALL in R studio Q 1 . 1 . Display the contents of the dataframe. # Do not display the dataframe, just its contents. #Q 2 . 2 . How many cases were sampled in the dataframe? #Q 3 . 3 . How many...
-
1- Analyze Boeing strategy in the location selection and layout of the venue where the airplanes are manufactured. 2- What is the type of inventory management does Boeing embrace? How does Boeing...
-
A consultant is beginning work on three projects. The expected profits from these projects are $50,000, $72,000, and $40,000. The associated standard deviations are $10,000, $12,000, and $9,000....
-
What are all of the differences between the enumeration types of C++ and those of Java?
-
What are the primary problems with using semaphores to provide synchronization?
-
What is multiple inheritance?
-
Why have business enterprises adopted codes of conduct?
-
What strategies does business use to manage legal risk?
-
What is the special meaning of public law as distinct from private law?
Study smarter with the SolutionInn App