Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  A
Language: C/C++
Code:
#include <stdio.h>
#include <conio.h>
#include <iostream>
#include <stdlib.h>
#include <iomanip>
#include <cmath>
int main()
{
     float tp,l,nps,v,d,e,tnt;
     printf("\tPOGC PIPING DEPARTMENT\n\tCreated by Y. EbrahimintBased on ASME BCC2 Part 5 (2008)");
     b: printf("nntTest Pressure (barg)= ");
     scanf("%f",&tp);
     printf("ntLength (m)= ");
     scanf("%f",&l);
     printf("ntNPS (inch)= ");
     scanf("%f",&nps);
     v=3.14159/4*(nps*25.4/1000)*(nps*25.4/1000)*l;
     printf("ntVolume= %2.1f m^3",v);
     e=0.25*(tp+1)*v*(1-pow((1/(1+tp)),0.286));
     printf("nntStored Energy= %2.1f MJ",e);
     tnt=e/4.26692;
     printf(" = %2.1f KG TNT",tnt);
     if(e<=135.5)
          printf("ntSafe Radius= 30 m");
     else if(e<=270)
          printf("ntSafe Radius= 60 m");
     else
     {
          printf("nnntDistancetBiological EffectstStructural Effects");
          printf("nt----------------------------------------------------------");
          d=20*pow(tnt,0.33333);
          printf("nt%2.1f mtt....tttGlass Windows",d);
          d=12*pow(tnt,0.33333);
          printf("nt%2.1f mttEardrum RupturttConcrete Block Panel",d);
          d=6*pow(tnt,0.33333);
          printf("nt%2.1f mttLung DamagettBrick Walls",d);
          d=2*pow(tnt,0.33333);
          printf("nt%2.1f mttFatalttt....",d);
     }
     _getch();
     goto b;
     return 0;
}     
          
          
          
Comments: