function to cal avg, put in performance formula and compare

Hi all,

need to do a function to cal avg, put in performance formula and compare

Performance = (Annual Average Actual Output Capacity / Annual Average Expected Output Capacity) * 100

a function, calPerformance that takes in the two-dimensional array, MT as input parameter. The function traverses the MT array, computes the annual average performance of each machine and displays the machine number that gives the best and worst performance. The function prototype is void calPerformance (machineType[4][12])

i have a head start of this

struct MachineType
{
int actual;
int expected;
};
MachineType MT[4][12];
void calPerformance(MachineType MT[4][12]); //Function prototype

Your kindness is appreciated!
Last edited on
We can see that each element in the 2D array is a MachineType struct.

However, you do refer to "each machine". What is "a machine"? Is it an element in the array?

What is "machine number"? Is it stored somewhere, or implicit?

How do you "traverse array"?
How do you "calculate average"?
How do you "find minimum and maximum" from a list of values?
Topic archived. No new replies allowed.