Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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]
expand button
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]
expand button
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
Check Mark
Knowledge Booster
Background pattern image
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
    Recommended textbooks for you
    Text book image
    Database System Concepts
    Computer Science
    ISBN:9780078022159
    Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
    Publisher:McGraw-Hill Education
    Text book image
    Starting Out with Python (4th Edition)
    Computer Science
    ISBN:9780134444321
    Author:Tony Gaddis
    Publisher:PEARSON
    Text book image
    Digital Fundamentals (11th Edition)
    Computer Science
    ISBN:9780132737968
    Author:Thomas L. Floyd
    Publisher:PEARSON
    Text book image
    C How to Program (8th Edition)
    Computer Science
    ISBN:9780133976892
    Author:Paul J. Deitel, Harvey Deitel
    Publisher:PEARSON
    Text book image
    Database Systems: Design, Implementation, & Manag...
    Computer Science
    ISBN:9781337627900
    Author:Carlos Coronel, Steven Morris
    Publisher:Cengage Learning
    Text book image
    Programmable Logic Controllers
    Computer Science
    ISBN:9780073373843
    Author:Frank D. Petruzella
    Publisher:McGraw-Hill Education