Question: C++ code Goal: practicing functions with reference parameters Problem: Create a program that contains two functions: main and a void function to read data from
C++ code
Goal: practicing functions with reference parameters
Problem: Create a program that contains two functions: main and a void function to read data from a file and process it. Your main function should prompt the user to enter the name of the file (Lab7.txt), store this name, and then call the function sending the name of the file to the function. After the function has completed, the main function should output the total number of values in the file, how many of the values were odd, how many of the values were even, and how many of the values were zero.
Your other function should accept the string object containing the name of the data file and other parameters as needed. This function should define a file object for input, open the file, skip over the first line (do not store the first line). Then this function should use a single loop to count the total number of values in the file, how many of those values were even, how many of those values were odd, and how many of those values were zero (do not include zeros as even). After all the values have been read and processed, this function should send back to main the number of values in the file, the number of zeros, the number of odd and the number of even values. Carefully consider which parameters should be passed by value and which should be reference parameters.
Remember to write your function definition after main and write a function declaration (prototype) before main for your function. Write comments immediately before your new function describing the task of the function, input, output, and processing for the second function. Do not use the same variable name in multiple (more than one) functions.
Lab 7 data
31
41
- 37
41
13
- 40
- 22
5
46
46
- 34
47
46
- 1
30
- 36
- 8
42
29
46
16
- 46
35
43
18
0
24
- 11
16
- 33
21
- 47
- 22
- 45
- 40
32
19
- 18
45
- 47
- 6
- 12
27
0
- 31
- 1
- 5
15
21
25
- 22
18
16
- 34
- 38
0
46
- 16
9
- 28
25
- 24
1
20
39
46
5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
