Question: . Open mileage - array.php and you will see that the code already declares an array that contains the mileage for 2 0 trips. Use

. Open mileage-array.php and you will see that the code already declares an array that contains the
mileage for 20 trips. Use a FOR loop to process this array one element at a time as follows: accumulate
the total mileage for all the trips ($totalMiles); determine the highest value in the array ($longestTrip);
find the lowest value in the array ($shortestTrip); count the number of array elements where the
mileage is 100 or higher ($longTrips). Also calculate the average of the 20 mileage values. Use the
sizeof() function to control the loop and to calculate the average. A print statement to print the results is
provided and does not need to be changed but be sure your variable names match those used in the
print statement.
. Open mileage - array.php and you will see that

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 Programming Questions!