Professional Documents
Culture Documents
int main ()
{
char input;
float E,I;
float f,l,udl,max,a,slope,x,deflection,Wo,m;
switch (input)
{
case '1':
cout<<"This program calculate the maximum deflection slope at the free
end. \n";
cout<<"Please insert the data. \n"<<endl;
cout<<"Please insert the value of modulus of elasticity E"<<endl;
cin>>E;
cout<<"Please insert the value of moment of inertia I"<<endl;
cin>>I;
cout<<"Force"<<endl;
cin>>f;
cout<<"Length"<<endl;
cin>>l;
cout<<"Length of X"<<endl;
cin>>x;
max = (f)*(l*l*l)/(3*E*I);
deflection = ((f)*(x*x)/(6*E*I))*((3*l)-x);
cout<<"The value of deflection Y in terms of X is "<<deflection<<endl;
cout<<"The maximum deflection at the free end is "<<max<<endl;
break;
case '2':
cout<<"This program calculate the maximum deflection slope at any point. \n";
cout<<"Please insert the data. \n"<<endl;
cout<<"Please insert the value of modulus of elasticity E"<<endl;
cin>>E;
cout<<"Please insert the value of moment of inertia I"<<endl;
cin>>I;
cout<<"Value of 'a'"<<endl;
cin>>a;
cout<<"Value of 'x'"<<endl;
cin>>x;
cout<<"Force"<<endl;
cin>>f;
cout<<"Length"<<endl;
cin>>l;
max = (((f)*(a*a))/(6*E*I))*((3*l)-a);
if (x<a)
deflection = ((l)*(x*x)/(6*E*I))*((3*a)-x);
else (a<x);
deflection = ((f)*(a*a)/(6*E*I))*((3*x)-a);
cout<<"The value of deflection Y in terms of X is "<<deflection<<endl;
cout<<"The maximum deflection at the free end is "<<max<<endl;
break;
case '3':
cout<<"This program calculate the maximum deflection slope on uniformly
distributed load. \n";
cout<<"Please insert the data. \n"<<endl;
cout<<"Please insert the value of modulus of elasticity E"<<endl;
cin>>E;
cout<<"Please insert the value of moment of inertia I"<<endl;
cin>>I;
cout<<"Value of 'x'"<<endl;
cin>>x;
cout<<"Uniformly Distributed Load (kN/m^2)"<<endl;
cin>>f;
cout<<"Length"<<endl;
cin>>l;
max =((f)*(l*l*l*l)/(8*E*I)) ;
deflection =(((f)*(x*x))/(24*E*I))*((x*x)+(6)*(l*l)-(4*l*x));
cout<<"The value of deflection Y in terms of X is "<<deflection<<endl;
cout<<"The maximum deflection at the free end is "<<max<<endl;
break;
case '4':
cout<<"This program calculate the uniformly varying load with maximum
intensity Wo (kN/m). \n";
cout<<"Please insert the data. \n"<<endl;
cout<<"Please insert the value of modulus of elasticity E"<<endl;
cin>>E;
cout<<"Please insert the value of moment of inertia I"<<endl;
cin>>I;
cout<<"Value of 'x'"<<endl;
cin>>x;
cout<<"Uniformly distributed load (kN/m^2)"<<endl;
cin>>udl;
cout<<"Length"<<endl;
cin>>l;
Wo = ((15)/(l-x))*(l);
max =((Wo)*(l*l*l*l))/(30*E*I);
deflection = (((Wo)*(x*x)/(120*E*I))*(((10)*(l*l*l))-((10)*(l*l))+
((5)*(l)*(x*x))-(x*x*x)));
cout<<"The value of deflection Y in terms of X is "<<deflection<<endl;
cout<<"The maximum deflection at the free end is "<<max<<endl;
break;
case '5':
cout<<"This program calculate the maximum deflection slope on couple moment
(M) at free end. \n";
cout<<"Please insert the data. \n"<<endl;
cout<<"Please insert the value of modulus of elasticity E"<<endl;
cin>>E;
cout<<"Please insert the value of moment of inertia I"<<endl;
cin>>I;
cout<<"Value of 'x'"<<endl;
cin>>x;
cout<<"Moment (kN/m)"<<endl;
cin>>m;
cout<<"Length"<<endl;
cin>>l;
max =((m)*(l*l)/(2*E*I));
deflection =((m)*(x*x)/(2*E*I));
cout<<"The value of deflection Y in terms of X is "<<deflection<<endl;
cout<<"The maximum deflection at the free end is "<<max<<endl;
break;
}
cout<<"Thank You for using our program"<<endl;
return 0;
}