. Implement a program that randomly generates 10 integers from -100 to 100, stores them in a 1D array, and finds their maximum value. Calculate the execution time of finding a maximum. Repeat the test for 10,000 and 10,000,000 numbers. Provide your results in the form of a table below and provide a small summary. Implement a Java program that will populate a 5x5 matrix with randomly generated integers from 0 to 100. (1) print your matrix in a table form. (2) modify your code to multiply all even numbers by 10 and print the matrix.

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter8: Working With Trendlines, Pivottables, Pivotcharts, And Slicers
Section: Chapter Questions
Problem 8EYW
icon
Related questions
Question

in java ecplise

. Implement a program that randomly generates 10 integers from -100 to 100,
stores them in a 1D array, and finds their maximum value. Calculate the
execution time of finding a maximum. Repeat the test for 10,000 and
10,000,000 numbers. Provide your results in the form of a table below and
provide a small summary.

Implement a Java program that will populate a 5x5 matrix with randomly
generated integers from 0 to 100.
(1) print your matrix in a table form.
(2) modify your code to multiply all even numbers by 10 and print the matrix.

Your output of questions (1) and (2) should match the format of the following
sample outputs: 

Lab 3: 1-D Array Operations X Untitled document - Google X
← → C
CPS 2231 Assignment2.pdf
44°F
Mostly cloudy
kean.instructure.com/courses/12224/assignments/56660
Assignments
Array size
Time
Assignment 2: 1D & 2D Array X
// put your code here.
end = System.nanoTime();
time = end - begin;
10
▬▬
b My Questions | bartleby X
O Search
10,000
Hint: You can use the following to generate random numbers:
(int) (Math.random() * 101 * (Math.random() > 0.5 ? 1: -1));
Page <
Hint: You can use the following statements to calculate execution time.
long begin, end, time; // we will measure time it took
begin = System.nanoTime(); //we measure in nanoseconds.
a
New Tab
1
> of 3
10,000,000
Sample run:
It took 22000 nanoseconds to find a maximum in the array of 10 elements. The maximum is: 100.
X +
Download
R=J
i Info
ZOOM +
J
X Close
O
9:43 PM
2/9/2023
X
Transcribed Image Text:Lab 3: 1-D Array Operations X Untitled document - Google X ← → C CPS 2231 Assignment2.pdf 44°F Mostly cloudy kean.instructure.com/courses/12224/assignments/56660 Assignments Array size Time Assignment 2: 1D & 2D Array X // put your code here. end = System.nanoTime(); time = end - begin; 10 ▬▬ b My Questions | bartleby X O Search 10,000 Hint: You can use the following to generate random numbers: (int) (Math.random() * 101 * (Math.random() > 0.5 ? 1: -1)); Page < Hint: You can use the following statements to calculate execution time. long begin, end, time; // we will measure time it took begin = System.nanoTime(); //we measure in nanoseconds. a New Tab 1 > of 3 10,000,000 Sample run: It took 22000 nanoseconds to find a maximum in the array of 10 elements. The maximum is: 100. X + Download R=J i Info ZOOM + J X Close O 9:43 PM 2/9/2023 X
Lab 3: 1-D Array Operations X Untitled document - Google X
← → C
CPS 2231 Assignment2.pdf
44°F
Mostly cloudy
Assignment 2: 1D & 2D Array X
kean.instructure.com/courses/12224/assignments/56660
Assignments
b My Questions | bartleby X
Page < 2
> of 3
12/ mouny your coue to marciply an even numbers by 10 and print the matha.
Initial Matrix:
Your output of questions (1) and (2) should match the format of the following
sample outputs:
941
541
211
59|
361 901 821 41|
851 871 35| 100|
21| 661 231
791
2
100| 01 31|
861 14| 421 561
141
New Matrix:
851 871
211 6601
20 1000
8601
140
35 1000
231 791
0| 31|
140| 420| 5601
360 900 820|
New Tab
9401
5401
21|
59|
411
a
(3) After multiplying all even numbers by 10, write code to sum all elements in
each row and print the results.
O Search
X +
Download
R=J
i Info
ZOOM +
J
X Close
O
9:44 PM
2/9/2023
X
Transcribed Image Text:Lab 3: 1-D Array Operations X Untitled document - Google X ← → C CPS 2231 Assignment2.pdf 44°F Mostly cloudy Assignment 2: 1D & 2D Array X kean.instructure.com/courses/12224/assignments/56660 Assignments b My Questions | bartleby X Page < 2 > of 3 12/ mouny your coue to marciply an even numbers by 10 and print the matha. Initial Matrix: Your output of questions (1) and (2) should match the format of the following sample outputs: 941 541 211 59| 361 901 821 41| 851 871 35| 100| 21| 661 231 791 2 100| 01 31| 861 14| 421 561 141 New Matrix: 851 871 211 6601 20 1000 8601 140 35 1000 231 791 0| 31| 140| 420| 5601 360 900 820| New Tab 9401 5401 21| 59| 411 a (3) After multiplying all even numbers by 10, write code to sum all elements in each row and print the results. O Search X + Download R=J i Info ZOOM + J X Close O 9:44 PM 2/9/2023 X
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning