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.
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.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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.

Transcribed Image Text:computer science proj X
Lab 3: 1-D Array Opera X
kean.instructure.com/courses/12224/assignments/56660
← → C
CPS 2231 Assignment2.pdf
44°F
Mostly cloudy
Assignments
Assignment 2: 1D & 2 x
Course Modules: Libra X
Unit 4 AS1: Assignmer X
Due Date: Listed on Canvas
10
Page < 1
b Answered:. Implemen x +
1. 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.
10,000
Submission requirement: (1) Provide the source code file (task1.java file), (2)
Take a screenshot of at least one successful run matching the sample output, (3)
Try different array sizes and save your results in the following form, this table
can be autogenerated or created manually.
Save (2) and (3) in a Google doc/Microsoft word document.
Array size
Time
> of 3
10,000,000
Hint: You can use the following statements to calculate execution time.
long begin, end, time; // we will measure time it took
▬▬
O Search
a
Download
i Info
R
ZOOM +
J
X Close
O
8:36 PM
2/10/2023
X

Transcribed Image Text:computer science proj X
Lab 3: 1-D Array Opera X
kean.instructure.com/courses/12224/assignments/56660
← → C
CPS 2231 Assignment2.pdf
44°F
Mostly cloudy
Assignments
Assignment 2: 1D & 2 x
Array size
Time
Save (2) and (3) in a Google doc/Microsoft word document.
end = System.nanoTime();
time = end - begin;
Course Modules: Libra X
▬▬
10
Unit 4 AS1: Assignmer X
O Search
Page <
10,000
Hint: You can use the following to generate random numbers:
(int) (Math.random() * 101 * (Math.random() > 0.5 ? 1 : -1));
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.
// put your code here.
a
1
b Answered:. Implemen x +
> 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.
Download
i Info
R
ZOOM +
J
X Close
O
8:36 PM
2/10/2023
X
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images

Knowledge Booster
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.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education