Question
Question
Given a text file containing integer numbers, you are tasked to find the average of all the even numbers within the file.
Sample input text files are provided (sample_input1.txt, sample_input2.txt, sample_input2.txt) with the corresponding expected output.
Use these to test your code as shown below;
- even_num_average(“sample_input1.txt”) —> output = 17
- even_num_average(“sample_input2.txt”) —> output = 25.333
- even_num_average(“sample_input3.txt”) —> output = 478.029
Note
- The output file should be named “output.txt”. This is already coded within the starter template provided. Do not change the naming.
- Do not change the name of the function in the submission.h file
- Write your function (answer) within submission.h
- Use main.cpp to test out your code (This time you do not need to comment int main out when submitting)
Deadline
10th November 2022, 11:59 PM.
Guidelines
- This is a group assignment
- Maximum group size is 5
- Decide your group members before joining the assignment and create a group on the page afterwards.
- Groups already made, remain intact and shall be used throughout all assignments.
- To make adjustments to groups, reach out to your respective TA.
- One member is needed to make a group and the rest are required to join that group.
- Uniquely name your group (Advised to use the name of one group member to avoid repetition of names)
- Only one member is needed to submit on behalf of the group, however, all members have the ability to submit.
Assignment Registration
- Join the assignment page;