Part 1. a. Create a 1D array of Integers of size 10 to store 10 Integers from 1 to 10. b. Using the following for loop: for (int i = 11; i « 50; i*) add values from 11 to 50 (1 Integer per iteration...


Part 1


Java


Part 1.<br>a. Create a 1D array of Integers of size 10 to store 10 Integers from 1 to 10.<br>b. Using the following for loop: for (int i = 11; i « 50; i*)<br>add values from 11 to 50 (1 Integer per iteration of the loop) to an array to store them and display the length of<br>your array at each iteration (after one more Integer is added the array Reference Variable should still be the<br>same).<br>Hint: you only can add one Integer at a time and increase the length of an array by one at each iteration.<br>c. Record and display the run-time it took to add and store all 40 Integers added one by one in the array and<br>displaying its length after every Integer is added.<br>d) Print the elements of your array using for-each loop.<br>

Extracted text: Part 1. a. Create a 1D array of Integers of size 10 to store 10 Integers from 1 to 10. b. Using the following for loop: for (int i = 11; i « 50; i*) add values from 11 to 50 (1 Integer per iteration of the loop) to an array to store them and display the length of your array at each iteration (after one more Integer is added the array Reference Variable should still be the same). Hint: you only can add one Integer at a time and increase the length of an array by one at each iteration. c. Record and display the run-time it took to add and store all 40 Integers added one by one in the array and displaying its length after every Integer is added. d) Print the elements of your array using for-each loop.

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here