So I'm very new to C programming and I'm being asked to write a programming to compute the mean effective pressure of an internal combustion engine's cylinder.
I'm given:
MEP = (66,000 * HP) / (L * A * RPM)
A = (pi * D^2) / 4 (cross sectional area of the cylinder
D = 3.5in. (Cylinder diameter)
L = 0.417ft (cylinder stroke)
RPM = 5000
HP = 110
I'm supposed to output the Bore (in), Stroke (ft), and the MEP (psi).
This seems like a relatively easy programming, but I just need a few walkthroughs to get me to the finish line. I'm using LCC-Win for testing. That is what I have so far:
int main()
{
float A, MEP, D, A, L, RPM, HP; //declaring all variables
D = 3.5;
L = .417;
RPM = 5000;
HP = 110;
MEP = (66000*HP)/(L*A*RPM);
double compute_area(double diameter);
const double pi = 3.14159265;
return (pi * diameter * diameter) / 4;
}
You can try this: