I am writing a beam analysis program, and I need to use a constructor method defining the + sign as increasing the length L of the beam by the amount passed as the parameter to the method.
For instance, if the object variable is named THE_BEAM, then the statement THE_BEAM + 5; should add 5 inches to the length L of the beam object and recalculate all of the calculated values.
I am having some trouble figuring out how to do this...can anyone give me some pointers? I have included sections of my code below:
main program:
//parameter for original length (also a user-input):
double Ll;
if (menu == 5)
{
BEAM P1,P2;
double input;
cout << "Please enter the length of the section to weld: " << endl;
cin >> input;
P1.L=input;
cout << "The length to weld is: " << P1.L;
P2=P1 + Ll;
cout << P2;
}