Write a C++ program using the information describe above that computes the maximum load in lbs(pounds) that can be placed at the end of an 8-foot (96 inches) 2” × 4” wooden beam so that the stress on the fixed end is 3000 lb/in2 .
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
double m;
double n;
double Q;
double p;
double l;
cout << "\nEnter the value for load weight(lbs)";
cin >> m;
cout << "\nEnter value for beam length(ft)";
cin >> n;
cout << "\nEnter value for modulous of elasticity(lb/ft^2)";
cin >> Q;
cout << "\nEnter value for beam's base(ft)";
cin >> p;
cout << "\nEnter value for beams height(ft)";
cin >> l;
double x;
x = (4 * m*(n*n*n)) / (Q*p*(l*l*l));
cout<<"Maximum load in lbs(pounds) is "<<x;
return x;
}
Comments
Leave a comment