NO

Author Topic: Write a program which uses functions to calculate.....????????  (Read 2434 times)

kiki

  • Guest
Hello!!!
I need help with my assignment.
It states to use functions to calculate EOQ, well I don't know what they mean by this.
The answer for EOQ should be 6500 and I get 6502.

Thank you,


#include <stdio.h>
#include <math.h>

int main (void)
{
int EOQ; // The economic ordering quantity
int TIC; // The total inventory costs

double F = 1000;
double S = 26000;
double C = 0.25;
double P = 4.92;

// Calculate the economic ordering quantity
EOQ = sqrt (2*F*S) / sqrt (C*P);
printf ("\nThe economic ordering quantity is: %d \n\n", EOQ);

// Calculate the total inventory costs
TIC = (C*P)*(EOQ/2) + F*(S/EOQ);
printf ("The total inventory costs are: %d \n", TIC);

return (0);
}