I have a question for this assignment that I need completed by tonight and i'm stuck! I'm getting an error in compiling at the t1.setTime1() function.
Thanks!
Below is the question.
Write a program in which you create a const whose value is determined at runtime by reading the time when the program starts (hint: use the <ctime> standard header). In a separate function, have the program create two arrays of 10,000 doubles. Initialize the first array with sequential integral values starting with 100, and initialize the second array with the same numbers, but in reverse order (i.e., the first array would contain 100, 101, 102… while the second array contains 10,099, 10,098, 10,097…). Loop through both arrays using a single loop, and multiply the corresponding array elements from each array together and display the result. Read the time when the program completes the multiplication, and compute and display the elapsed time. Do not use inline functions in this program. Rewrite program 1 using an inline function to perform the calculation. In the test plan for this program (actual results section), compare the time required by this program to execute against the time required by the first (non-inline) program.
there is no parameter supplied when calling the function.
Line 37
t3 = clock();
what is t3? is it the parameter passed when the function is called? Or is it the member variable defined at line 17?
It looks like the latter. In which case, there is no need for the parameter in the function call - modify the function accordingly at lines 11 and 35 to remove the parameter.