Question

In: Computer Science

The purpose of this program is to identify the forces of each member of the truss below

 C++ Program Assignment

 The purpose of this program is to identify the forces of each member of the truss below (FAB, FAD, FBC, FBD, FBE, FCE, FDE) and to state whether they are in tension or compression. Use the example we worked in class to determine the reaction forces (Ax, Ay, and Cy) and complete the analysis by the Method of Joints. When you have finished the program, you will upload the .cpp file to D2L in the Assessment Dropbox folder named C++ Program. Check with me before you leave to make sure I have received your file.

image.png

 Program Requirements

 1. Use CodeBlocks to build and run your program. Name your program: Lastname_Truss.cpp 

2. Your code should be properly commented to describe what you are doing.

 3. The user should be prompted to enter pitch width, x, height, h, and the applied forces Fi and F2 4. You must create and use a function to calculate the hypotenuse of the right triangle you will need to help determine x and y force components of the truss members.

 5. You must create and use a function to evaluate whether a force in Tension or Compression. The function will be called multiple times, once for each member. Any force value that has a

 magnitude from-0.00001<F< 0.00001 will be considered a Zero Force member.

 6. You must store each Force member name as a constant character string. For example, FAD will be stored as "Fad" for the string. You will use these character strings when you display your output.

 7. Your output must be clearly stated to the user. For example, if FAD =-200, then your output should read something like: Fad has a magnitude of 200 and is in Compression. If FBC = 150, then it will be: Fbc has a magnitude of 150 and is in Tension.



Solutions

Expert Solution

Corrected all the errors from your program.

Its running fine now.

program and output are as follow.

**********************************************program********************************

#include
#include
using namespace std;
int main()
{
float x,y, F1,F2,Cy,Ay,Z,Fad,Fab,Fbd,Fde,Fbe,Fbc,Fce;
float z; // z variable
float h; //height variable
//prompt the user to enter pitch width x,height h and applied forces F1,F2
cout<<"Enter pitch width x height h, and the applied forces F1,F2:"< cin>>x>>h>>F1>>F2;
Cy=(((1/4)*F1)+((3/4)*F2));
Ay=(((3/4)*F1)+((1/4)*F2));
z=sqrt(((1/4)*x*x)+h*h);
Fad=(-(z/h)*Ay);
Fab=((-x/(2*z))*Fad);
Fbd=(-Fad-(z/h)*F1);
Fde=((x/(2*z))*(Fad-Fbd));
Fbe=(-Fbd);
Fbc=Fab+(x/(2*z))*(Fbd-Fbe);
Fce=(-(z/h)*Cy);
if((Fad||Fab||Fbd||Fde||Fbe||Fbc||Fce)<0)
{
cout<<"Zero force member";
}
else if((Fad||Fab||Fbd||Fde||Fbe||Fbc||Fce)>=200)
{
cout<<" magnitude is compression";
}
else if((Fad||Fab||Fbd||Fde||Fbe||Fbc||Fce)<=150)
{
cout<<"magnitute is tension";
}
}

***********************************output***************************************

Enter pitch width x height h, and the applied forces F1,F2:

8

15
60
90
magnitute is tension


Related Solutions

Determine the force in each member of the truss supporting a floor deck
Determine the force in each member of the truss supporting a floor deck as shown in Fig. P4.28. The deck is simply supported on floor beams which, in turn, are connected to the joints of the truss. Thus, the uniformly distributed loading on the deck is transmitted by the floor beams as concentrated loads to the top joints of the truss.
if the truss structure is inverted, explain how this effect on the truss forces and when...
if the truss structure is inverted, explain how this effect on the truss forces and when this geometric arrangement can used in structural schemes ?
Discuss the result of the design of fillet weld for a tie member of a truss...
Discuss the result of the design of fillet weld for a tie member of a truss consist of an angle section ISA 100 x 75 x 8 mm of Fe410 grade, is welded to an 8 mm gusset plate. Design a weld to transmit a load equal to the full strength of the member. Assume shop welding. If the gusset plates are connected by 2 angle section ISA 65 x 65 x 6 mm back to back to the same...
As shown, the truss is loaded by the forces P1P1P_1 = 425 NN and P2P2P_2 =...
As shown, the truss is loaded by the forces P1P1P_1 = 425 NN and P2P2P_2 = 865 NN and has the dimension aaa = 1.10 mm .sing the method of joints, determine FABFABF_AB, FBCFBCF_BC, and FBDFBDF_BD, the magnitude of the force in each of the members connected to joint B. Assume for your calculations that each member is in tension, and include in your response the sign of each force that you obtain by applying this assumption
Determine the force in members CD of the truss, and state if the member is in tension or compression.
Part ADetermine the force in members CD of the truss, and state if the member is in tension or compression. Take P = 1675 lb (Figure 1) Express your answer to three significant figures and include the appropriate units. Assume positive scalars for members in tension and negative scalar for members in compressionPart B Determine the force in members HI of the truss, and state if the member is in tension or compression. Take P = 1675 lb Part C  Determine the force in members CJ...
A pin-ended chord of a truss is treated as a member in a braced frame. Its...
A pin-ended chord of a truss is treated as a member in a braced frame. Its length is 12 ft. It must carry a tension dead load of 95 kips and live load of 180 kips along with a uniformly distributed transverse dead load of 1.2 kips/ft and live load of 2.3 kips/ft. Will a W8x67, A992 member be adequate if the transverse load is applied to put the bending about the strong axis? Determine by (a) LRFD and (b)...
a. Identify and briefly describe a loyalty program that you are either a member of and/or...
a. Identify and briefly describe a loyalty program that you are either a member of and/or feel is a good customer (Business to Consumer) loyalty program. b. Identify and explain the learning theory which underpins this loyalty program. c. Suggest some additional initiatives that could be added or changed with this program to increase loyalty (note: identify if these would be aimed at achieving affective loyalty and/or behavioural loyalty).
Solve for the forces in truss members using the method of sections I just need an...
Solve for the forces in truss members using the method of sections I just need an example
Identify six forces of change and provide examples of each
Identify six forces of change and provide examples of each
For each pair of substance, identify the dominant intermolecular forces in each substance, (and select the...
For each pair of substance, identify the dominant intermolecular forces in each substance, (and select the substance with the stronger intermolecular forces) A.) MgCl2 or PCl3 B.) CH3NH2 or CH3F C.) CH3OH or CH3CH2OH D.) Hexane or Dimethylbutane Please show all steps clearly.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT