0% found this document useful (0 votes)
52 views2 pages

Scrid

This C++ program defines a function called "stress_values" that takes in integer parameters for material type, shape, and grade and returns integer values for design stress values dv1 and dv2 depending on the inputs. It contains if/else statements to return different values based on whether the material is carbon steel or alloy steel, and switches to return the correct values based on the grade input.

Uploaded by

Ndunya Westley
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views2 pages

Scrid

This C++ program defines a function called "stress_values" that takes in integer parameters for material type, shape, and grade and returns integer values for design stress values dv1 and dv2 depending on the inputs. It contains if/else statements to return different values based on whether the material is carbon steel or alloy steel, and switches to return the correct values based on the grade input.

Uploaded by

Ndunya Westley
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

C++ PROGRAM FOR PRESSURE VESSELS

#include <iostream>
#include <math.h>

using namespace std;


int stress_values(int m, int s, int g){
int dv1, dv2;
if(m==1 & s==1){
switch(g){
case 1://grade 55
dv1=13800; dv2=18300; break;
case 2://grade 60
dv1=17114.5; dv2=20000; break;
case 3://grade 65
dv1=16300; dv2=21700; break;
case 4://grade 70
dv1=20015; dv2=23300; break;
}
}
if (m==1 & s==2){//SA-285
switch(g){
case 1://grade A
dv1=11300; dv2=15000; break;
case 2://grade B
dv1=12500; dv2=16700; break;
case 3://grade C
dv1=13800; dv2=18300; break;
}

You might also like