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

Mainly focusing on part 2. the programming language is C. I do not even know how

ID: 3919671 • Letter: M

Question


Mainly focusing on part 2. the programming language is C. I do not even know how to do the options for Part 2 on paper.

Project Description General The input to the program will be a text file containing the information for a tolerance table. An example follows. These values will be stored in a text file. The data is comma delimited, which means that each data field is separated by a comma. If the first word is PART' the following values are the nominal size, +/-impact, tolerance, and fixed/variable. If the first word is' GAP' the following values are the minimum and maximum sizes. (Note: assume all units are inches.) The program should be able to handle any number of parts. PART, 2.000,-1,0.050, v PART, 0.975, -1,0.025,V PART, 3.000, +1,0.010,F GAP, 0.000,0.080 The program should also include an interactive method for the user to choose which part of the program to run (Part I, II, or III), with a description of what each part will do. Part I These values will be processed using the method taught in class. A sample output for the first stage is given (you may use your own verbiage, but ensure that the same information is provided) Basic Gap: 0.025" Basic Gap Tolerance: 0.085" The Maximum Gap (0.110") is (Greater) than specified (0.080") The Minimum Gap (-0.060") is (Less) than the specified (0.000") Part II The second phase extends the Stage I analysis. In this stage the program will suggest various combinations of part dimensions and tolerances to meet the gap specifications. It should incorporate a menu that allows the user to select from at least two methods of determining recommended dimensions and tolerances. Some of the options for suggestions include 1. For each variable (V) part find the largest tolerance value, and new nominal value. Note: This is done for one part at a time, with all other parts having no tolerance. 2. For all variable parts use a scaling factor to reduce/multiply all tolerance values to fit Equally divide the tolerance among all variable parts.

Explanation / Answer

Please adjust variables according to your part 1, This is basic programming in c for Tolerance Analysis in Computer Aided Engineering. Your part 1 is a program that will load a tolerance table and estimate gap sizes and tolerances. And part 2 suggest options for changing tolerances and dimensions to meet the design specification. I have written functions of Part2 with a code which we had learned at our engineering school.  

int adjust_parts(){
double gap_tolerance, gap_tolerance_min, gap_tolerance_max;
int variable_part_cnt;
double wiggle_room;
int i, j;
printf(" Adjusting parts values ");
// getting numbers first
gap_tolerance = (gap_max - gap_min) / 2.0;
gap_tolerance_min = gap_tolerance_max = 0.0;
variable_part_cnt = 0;
srand(time(NULL)); // changing the seed
for( i = 0; i < part_cnt; i++ ){
// gap_nominal += part_nominal[i] * part_sign[i];
gap_tolerance_max += part_tolerance[i];
if( part_variability[i] == 'F' ){
gap_tolerance_min += part_tolerance[i];
} else {
variable_part_cnt++;
}
}
if( gap_tolerance_min > gap_tolerance ){
printf("Error: The tolerance sum of the fixed parts is too large to work ");
return ERROR;
}
// Adjust the tolerances
wiggle_room = (gap_tolerance_max - gap_tolerance) / variable_part_cnt;
for( i = 0; i < part_cnt; i++ ){
if( part_variability[i] == 'V' ) part_tolerance[i] -= wiggle_room;;
}
// now that the tolerances are adjusted, time for the dimensions
wiggle_room = ((gap_max - gap_min)/2.0 - gap_mean) / variable_part_cnt;
for( i = 0; i < part_cnt; i++ ){
if( part_variability[i] == 'V' ) part_nominal[i] += wiggle_room * part_sign[i];
}
update_gap();
return NO_ERROR;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote