Question: I WANT THE flowchart AND THE Pseudo code FOR FOLLOWING CODE : #include #include float state1(); float state2(); float state3(); float state4(); float ope(); float

I WANT THE flowchart AND THE Pseudo code FOR FOLLOWING CODE :

#include #include

float state1(); float state2(); float state3(); float state4(); float ope(); float rocs();

int main() { int x; float call; printf("(MENU) Please select: 1.State 1 2.State 2 3.State 3 4.State 4 5.Overall plant efficiency 6.Rate of coal supply "); scanf("%d",&x); if(x==1) { call= state1(); } else if(x==2) { call= state2(); } else if(x==3) { call= state3(); } else if(x==4) { call= state4(); } else if(x==5) { call= ope(); } else if(x==6) { call= rocs(); } else { printf("*Invalid* "); }

} float state1() { float p=25.5,h1=277.40,s=0.9111,v=0.001020; printf("p=%.2fkPa h1=%.2fkJ/kg s=%.4fkJ/kgK v=%fm^3/kg ",p,h1,s,v); printf("The enthalpy in steam 1 is = %.2fkJ/kg",h1); } float state2() { float P1=25,P2=5000,h2,s=6.8210,v=0.001020,h1=277.40; printf("To find the enthalpy of state 2,we use formula: \th2=v(P2-P1)+h1 "); printf("P1=%.2fkPa h2=?kJ/kg s=%.4fkJ/kgK v=%fm^3/kg ",P1,s,v); h2=v*(P2-P1)+h1; printf("The enthalpy in state 2 is = %.2fkJ/kg",h2); } float state3() { float x[]={5000,3354.1,6.897,0.06402,3033.9}; printf("To find enthalpy in state 3, we ca refer the table A-6 "); printf("P3\t\th3\t\ts\tv\tu\t "); int i; for(i=0;i<5;i++) { printf("%.4f\t",x[i]); } printf(" The enthalpies in steam 3 is = %.2fkJ/kg",x[1]); } float state4() { float x4,s4=6.897,sf=0.8932,sg=7.8302,h4,hf=271.96,hfg=2345.5; printf("To find the enthalpy at state 4 we use the fact that the expansion of the steam turbine from state 3>4 is isentropic. s=6.897 kJ/kgK "); printf("We can determine the quality of the saturated liquid-vapor mixture at state 4 using formula: \tx4=(s4-sf)/(sg-sf) "); x4=(s4-sf)/(sg-sf); printf("x4=%.3f ",x4); printf("\th4 = hf@P=25kPa + x4*hfg@P=25kPa "); h4 = hf+ x4*hfg; printf("We get h4=%.2fkJ/kg",h4); } float ope() { float ncomb=0.75,nth,ngen=0.96,nov,h1=277.40,h2=282.47,h3=3354.1,h4=2301.93; nth=1-((h4-h1)/(h3-h2)); printf("By substituting the enthalpies into eqn: \tnth=1-((h4-h1)/(h3-h2)) we get nth=%.2f The overall plant efficiency can be calculated using formula: \tnoveral=ncomb x nth x ngen ",nth); nov=ncomb*nth*ngen*100; printf("the overall plant efficiency is %.1f percent",nov); } float rocs() { float m,E=300000,HV=29300,nov=0.245; printf("We can calculate the required rate of coal supply by substituting in the electric power output (300 MW), the heating value of coal (29300 kJ/kgcoal), and the overall efficiency (0.245) in the formula: \t mcoal=E/(HV*nov) "); m=E/(HV*nov); printf("The required rate of coal supply is %.2fkg/s",m); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!