Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

File ArraySize.h must contain the definitions of sufficient const int variables to provide the dimension sizes and total element count for a 4-dimensional array. The

File ArraySize.h must contain the definitions of sufficient const int variables to provide the dimension sizes and total element count for a 4-dimensional array. The dimension sizes, left-to-right, must be 10, 7, 6, and 8. You must include this file and use those variables in any files that need this information.

File WorkerFunction.cpp must contain a function named WorkerFunction. WorkerFunction syntax:

void WorkerFunction(float *nestedAvg, float *linearAvg); Parameters:

nestedAvg a pointer to a type float object in the instructor-supplied driver file

linearAvg a pointer to another type float object in the instructor-supplied driver file Synopsis:

Does only the following three things, in order: 1. declares a local, automatic, type float, 4-dimensional array named testArray whose

dimension sizes are specified by the variables in file C2A4E1_ArraySize.h 2. makes the exact function call RandomizeArray(testArray) 3. makes the exact function call ComputeAverages(testArray, nestedAvg, linearAvg)

Return:

void

File RandomizeArray.cpp must contain a function named RandomizeArray. RandomizeArray syntax:

void RandomizeArray(--One parameter; see the parameter description below--) Parameter:

You must design the appropriate parameter based upon the call to RandomizeArray shown in the

synopsis of WorkerFunction above. The parameter may not be a C++ reference type (note 5.9). Synopsis:

1. seeds the random number generator with the value of the real time clock (RTC) using the standard library srand and time functions;

2. initializes each element of the 4D array represented by the functions parameter with the unaltered values returned from repeated calls to the library rand function; do not normalize or restrict the range of those values in any way;

Return:

void

File ComputeAverages.cpp must contain a function named ComputeAverages. ComputeAverages syntax:

void ComputeAverages(--Three parameters; see the parameter description below--) Parameters:

You must design the appropriate parameters based upon the call to ComputeAverages shown in the synopsis of WorkerFunction above. The parameters may not be C++ reference types.

Synopsis:

1. computes the average of all elements in the 4D array represented by the functions 1st parameter, accessing them in order using nested for loops and 4D indexing; the result is stored in the address specified by the functions 2nd parameter. Ignore the potential for overflow or loss of precision when adding the element values.

2. computes the average of all elements in the 4D array represented by the functions 1st parameter, accessing them in order linearly using compact pointer operations; the result is stored in the address specified by the functions 3rd parameter. Ignore the potential for overflow or loss of precision when adding the element values.

Return:

void

Do not declare/create any arrays other than testArray.

Manually re-run your program several times; the average value should be different every time. If theyrennot something is wrong. Look up the description of the rand function and note the range of values it returns. Your average values should be approximately midway in this range.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

2. Discuss the steps in preparing a manager to go overseas.

Answered: 1 week ago