Question: Algorithm for (int x o; x 5; x 1) 1. repeat for (subscript from o to 4) enter finish time cout Time for race end


![race end repeat X 1 cin finish Times Ex]; //end for 2.](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f50c338a99d_47566f50c330c5bc.jpg)



Algorithm for (int x o; x 5; x 1) 1. repeat for (subscript from o to 4) enter finish time cout "Time for race end repeat X 1 cin finish Times Ex]; //end for 2. call the getAverage function to calculate avg Time getAverage (finish Times 5 the average finish time; pass the array and the number of elements lowest Time getLowest finish Times, 5 3. call the get Lowest function to determine the lowest finish time pass the array and the number of elements cout "Average 5K finish time: 4. display the average finish time and avgTime endl; the lowest finish time cout "Lowest 5K finish time lowest Time endl; getAverage function C++ instructions IPO chart information array lformal parameter) double times number of elements (formal parameter) int numElements double total 0.0 total time subscript (counter: o to one Less than declared and initialized in the for clause the number of elements) calculated in the return statement average finish time 1. repeat for subscript from o to one Less for int x 0: x numElements than the number of elements) add array subscript! time to total times LXI the total time //end for end repeat
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
