EGN 3211 – Spring 2025
Homework #3
You have been tasked to process Olympic competitors’ times for the 100-meter dash in the
2022 Solaris Olympic games. The races are conducted with 5 competitors at a time and there
will be two races. You will randomly generate two datasets of runners’ times to ensure your
solution will work with any given dataset. You will write four functions that perform operations
on arrays. Lastly, you will write a main function that calls your functions to create the desired
output.
Example Data
Race #1 (Men):
Competitor Time (seconds)
Fei Fong Wong 12.45
Usain Bolt 9.58
Joostin Ong 9.25
Jeff Jefferson 13.12
Uther Lightbringer 15.30
Race #2 (Women):
Competitor Time (seconds)
Elly Van Houten 9.34
Tokoyami Towa 10.25
Melia Antiqua 12.99
Nina Liebert 11.50
Amy Rose 9.62
Function Specifications
Your functions must have the following signatures and do what is described.
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.
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.
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.
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.
Main
Your main function must follow the following specifications:
1. Create an 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 fastest and slowest times in each
dataset.
5. Call your combine_arrays function to merge the men and women datasets into the
empty array created earlier.
6. Call your print_array function on each dataset to display all of their values.
Sample Outputs
Your output does not and should not be exactly the same as these samples. You have creative
liberty with how you want to display your outputs as long as you are calling your functions
(that work as expected) and labeling data clearly. Note: the sample outputs use the example
datasets given in this document, make sure you are following the assignment specifications and
generating your own random double values for your datasets.
Sample #1:
Sample #2:
Submission Instructions
You need to submit a single .c file. Save your code to a file named “arrayraces.c” and submit it
to canvas. You must write the main as specified in this document. Your functions must have the
same return types and input parameters and must perform the specified operations.
Your program MUST include the following header comment:
/*Student Assignment Submission Form
I declare that the attached assignment is wholly my own work in accordance with UCF
Academic Policy. No part of this assignment has been copied manually or electronically from
any other source (including web sites) or distributed to other students. My name is: LastName
FirstName, Date: mm/dd/yyyy */