Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Key Concepts: review of methods and documentation, file output, teamwork and com

ID: 3609912 • Letter: K

Question

Key Concepts: review of methods and documentation, file output, teamwork and communication, using applications together

This lab will be quite different from any other lab you have done or will do in that it will be done in teams of three. We will see abstraction truly come into play in this lab, as two of three members of the team will write function documentation and use it to communicate with the other team members, who will depend upon it to do their tasks. You may choose your own teams, but teams must be composed of students in the same section and each team must contain one student who is currently taking or has taken E MCH 213 (Strength of Materials) or who has taken E MCH 210.

You will all be working to solve the problem specified here:

The bolt of cross-sectional area A0 is placed inside a tube made of a different material but also of cross-sectional area A0. The assembly is completed by making the nut "finger-tight." The dimensions of the reduced segment of the bolt (length b and cross-sectional area A) are designed so that the segment will yield when the temperature of the assembly is increased by 200°F. Using your knowledge of solving statically indeterminate problems, determine the equation that would be used in a computer program to calculate the ratio A/A0 for a range of values for the ratio b/L. Assume that the bolt and tube are made of different materials and that the values of elastic modulus, thermal expansion coefficient, and yield strength are given. For your calculations, let L = 1 m.

The three components of the lab, which will be completed by individual teams members, are:

The lab structure will go as follows:

Set up a new C++ program and define constants for the temperature change and length of the bolt and tube as given in the problem statement.

Use your knowledge from E MCH 213 to derive an expression for A/A0. Assume that the coefficient of thermal expansion for the tube is always larger than that for the bolt. (Professor Masters and I designed this so that this same problem did recently show up in 213. The solution to that problem will be available via ANGEL on both the CMPSC 201 and E MCH 213 ANGEL sites.)

Then write a function that takes in the following parameters and computes A/A0:

Clarification: You may assume these variables are in the standard units used by your 213 course materials: psi for elastic moduli, inverse degrees F for coefficients of linear expansion, and ksi for yield strength.

Begin by writing your function header and pre- and postconditions and prepare to supply that (only) to your teammate solving Function #2. He/she will depend upon your documentation to do his/her task.

Write a function that takes in the following parameters and returns A/A0:

The materials from the bolt and the tube can be steel or aluminum.

Begin by writing your function header and pre- and postconditions and supplying that (only) to your teammate solving the main function. He/she will depend upon your documentation to do his/her task.

Note that you don't need to understand anything about the computation of the A/A0 ratio. Instead, you take advantage of abstraction and call Function #1 based upon the documentation your teammate should supply you. To implement your function, write selection logic to choose the correct material property values to call Function #1. Be very careful to pay attention to the preconditions specified for Function #1 and write your preconditions accordingly.

Here are the relevant material properties you need to know to do your job:

You should receive documentation from the person implementing Function #2. Note that you do not need to work with Function #1 directly.

Write a loop that runs the ratio b/L from 0 to 1 by hundredths and prints the ratio A/A0 for an aluminum tube and a steel bolt. Your output should be in the form of ordered pairs, as demonstrated below. Work with an aluminum tube and steel bolt.

Once you get the first scenario working, change the materials and give additional sample Partial Expected Output

If you've done everything correctly, your output should look something like this:

Elastic Modulus
(x 106 psi) Coefficient of Linear Expansion
(x 10-3/°F) Yield Strength
(x 103 ksi) Aluminum 10 .0128 37 Steel 29 .0065 35 Copper 15 .0096 50

Explanation / Answer

voidAddNumbers( double, double );

voidMultNumbers( double, double );

voidOutOpenMessage();

charInCommand();

intmain()

{

double firstDouble = 4.2;

double secondDouble = 6.5;

charcommand;

boolvalid = false;

OutOpenMessage(); // outputs opening screen message

do

{

command = InCommand(); //returns user input command

switch( toupper( command ) )

{

case'A':

AddNumbers( firstDouble, secondDouble ); //outputssum

valid= true;

break;

case'M':

MultNumbers(firstDouble, secondDouble ); //outputs product