You have been tasked to process Olympic competitors’ times for the 100-meter dash in the 2023Olympic games. The races are conducted with 5 competitors at a time and there will be tworaces. You will...

You have been tasked to process Olympic competitors’ times for the 100-meter dash in the 2023
Olympic games. The races are conducted with 5 competitors at a time and there will be two
races. You will generate two datasets of runners’ times to ensure your solution will work with
any given dataset. You will write five functions that perform operations on arrays. Lastly, you
will write a main function that calls your functions to create the desired output




Function Specifications

Your functions must have the following signatures and do what is described.





1. double find_max(double array[], int length);
This function takes a double array and its length as parameters and returns the maximum value in
the array.





2. double find_min(double array[], int length);
This function takes a double array and its length as parameters and returns the minimum value in
the array.





3. void combine_arrays(double src1[], int length1, double src2[],
int length2, double dest[]);
This function takes three double arrays as parameters: two source arrays and one destination
array. The length of the source arrays is also taken as a parameter. The function will combine
them both into the destination array.





4. void print_array(double array[], int length);
This function takes a double array as a parameter and prints all of its elements with two decimal
points as a comma separated list. For the final element, you should not print a comma and should
print a newline instead.





5. void sort_array(double array[], int length);
This function takes a double array and its length as parameters and sorts all of the elements in the
array from least to greatest.





Main

Your main function must follow the following specifications:

1. Create and array of type double with length 5 and populate it with randomly generated
values from 9.00 to 15.99. This will be the men’s dataset.

2. Repeat step 1 for the women’s dataset.

3. Declare an empty array of type double with length 10. This array will hold your
combined dataset.

4. Use your find_min and find_max functions to print out the fastest and slowest times in
each dataset.

5. Call your print_array function to print out the men’s dataset unsorted.

6. Call your print_array function to print out the women’s dataset unsorted.

7. Call your combine_arrays function to merge the men and women datasets into the empty
array created earlier.

8. Call your sort_array function to sort the combined dataset from least to greatest.

9. Call your print_array function to print out the sorted combined dataset.
Mar 15, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here