Question: Create an array and populate it with integers read in from the file numbers.text, then print out various items of information about the array (

Create an array and populate it with integers read in from the file numbers.text, then print out various items of information about the array (see below). You should assume a maximum of 100 numbers.
Sample Test Run
For example if the file numbers.text contains:
12.3
2.5
9.4
3.14
22.15
17
54.3
7.6
the program should produce the following output:
The array: {12.3,2.5,9.4,3.14,22.15,17.0,54.3,7.6} contains 100 elements of which 8 elements are being used
The first element of the array is 12.3
The last element of the array is 7.6 and is at position 7
The middle element of the array is 3.14 and is at position 3
There are 92 empty elements in the array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!