[Solved]Basic C C Java Python Visual Studio Xcode Assignment Description Assignment Ll Writing Pro Q37063635
In Basic C (not C++, Java, or Python) And in visual studio (notXcode):
Assignment Description
In this assignment, you’ll be writing a program that does 2things: calculate velocity vectors and durations for an industrialrobot to move its welding attachment between a set of weld pointsand calculating how long the entire set of movements will take.
Requirements
Your application must do the following:
- Print a “welcome” message to the user telling them what theapplication does
- Read in the set of points from a file named points.txt(provided at the bottom of this post)
- Calculate and save a velocity vector and a duration for movingfrom each point to the next point
- Write the velocity vectors and durations to an output filenamed moveinfo.txt
- Print out the total duration of all the moves required
Additional details
The welding attachment on the robot moves at exactly 1 foot persecond.
An example line from the input file:
2.267537,3.647459,-2.233978
The 3 values are the x, y, and z coordinates (in feet) of thepoint.
An example line from the required output file is:
0.4684,0.7534,-0.4615,4.8411
The first 3 values are the x, y, and z components of thevelocity vector (in feet per second) and the final value is theduration in seconds the welding attachment will move along thatvelocity vector. All values MUST be to 4 decimal places.
Make sure you use the output file format exactly as shown above(no extra spaces around the commas, for example). The grader willbe using an automated comparison tool to compare your output fileto the solution output file. If you don’t use the required formatin your output file, that tool won’t work, and you’ll get 0 pointsfor that portion of the programming assignment.
The total duration you output (to the console, not to the file)should be output to 4 decimal places. The total duration should bein seconds.
Helpful Hints
Make sure you put the points.txt file in the same folder as yourmain.c file in your Visual Studio project.
I defined two structs: a Vector struct to hold the point/vectorx, y, and z components and a MoveInfo struct to hold a velocityvector and the duration in seconds of a point-to-pointmovement.
Be sure to rewind the points file (or close it and reopen it)after counting the number of lines in the file so you can read theactual points starting at the beginning of the file.
Getting the x, y, and z components from a string from the pointsfile is a lot like getting a student from the File IO 3: Reading aFile lecture on Canvas. The only tricky part for you could begetting the z component rather than getting the student’s lettergrade. Here’s the code you can include instead of the code thatgets the letter grade (assuming you named your string parameterstring and your point parameter point):
// move past second comma and extract z
string = &string[0] + commaIndex + 1;
point->z = atof(string);
Because the speed for the welding attachment is 1 foot persecond, the velocity vector is simply the unit vector from the STEMComputations 5: Velocity lecture on Canvas. In addition, theduration of the move is just the length of that vector BEFORE younormalize it.
Note that your array of move info will be one smaller than yourarray of points. That’s because element 0 in your move info arrayshould be the velocity vector and duration to move from point 0 topoint 1, element 1 in your move info array should be the velocityvector and duration to move from point 1 to point 2, and so on.
Below is from points.txt file:
0.000000,0.000000,0.000000
-3.164497,2.579601,-2.772813
0.000000,0.000000,0.000000
-0.662436,2.457830,-2.777020
0.000000,0.000000,0.000000
1.491942,2.278017,-0.504800
0.000000,0.000000,0.000000
-0.684877,1.413279,-1.418542
0.000000,0.000000,0.000000
4.631861,3.221585,-1.699737
0.000000,0.000000,0.000000
-2.845812,3.720945,-0.311378
0.000000,0.000000,0.000000
4.378127,0.835080,-4.908822
0.000000,0.000000,0.000000
-1.406281,1.416366,-2.669790
0.000000,0.000000,0.000000
1.239070,3.625174,-3.749174
0.000000,0.000000,0.000000
-0.962437,1.996518,-3.510303
0.000000,0.000000,0.000000
0.522670,0.084607,-4.429338
0.000000,0.000000,0.000000
0.878252,2.797070,-5.661125
0.000000,0.000000,0.000000
-3.600078,0.603827,-0.240136
0.000000,0.000000,0.000000
-1.874853,1.734843,-2.994513
0.000000,0.000000,0.000000
-2.851953,0.083830,-5.973051
0.000000,0.000000,0.000000
-4.796505,3.131970,-3.497391
0.000000,0.000000,0.000000
-2.293227,0.524197,-2.131615
0.000000,0.000000,0.000000
-4.263008,0.510367,-3.772793
0.000000,0.000000,0.000000
3.613668,3.790388,-5.463001
0.000000,0.000000,0.000000
4.976241,0.768790,-2.028805
0.000000,0.000000,0.000000
-4.728341,2.013720,-1.894409
0.000000,0.000000,0.000000
1.469113,0.738937,-4.790492
0.000000,0.000000,0.000000
-1.461149,0.450884,-1.637350
0.000000,0.000000,0.000000
1.071238,3.312218,-5.747405
0.000000,0.000000,0.000000
-3.529875,3.506673,-0.964559
0.000000,0.000000,0.000000
-4.521590,2.550003,-3.338309
0.000000,0.000000,0.000000
1.924742,2.479359,-0.581695
0.000000,0.000000,0.000000
3.778963,1.542821,-1.564911
0.000000,0.000000,0.000000
-1.710165,3.299174,-4.775108
0.000000,0.000000,0.000000
4.190864,0.335253,-1.611056
0.000000,0.000000,0.000000
1.263587,1.850751,-5.661412
0.000000,0.000000,0.000000
4.107959,0.766770,-3.811326
0.000000,0.000000,0.000000
-3.593359,0.542343,-2.689558
0.000000,0.000000,0.000000
3.556639,3.582802,-0.156599
0.000000,0.000000,0.000000
-4.411367,0.189375,-3.082217
0.000000,0.000000,0.000000
2.695398,3.586283,-1.565958
0.000000,0.000000,0.000000
-0.210421,3.819560,-3.788347
0.000000,0.000000,0.000000
1.451037,3.132330,-3.679329
0.000000,0.000000,0.000000
3.737039,0.424921,-5.194158
0.000000,0.000000,0.000000
-1.559179,1.709787,-3.565255
0.000000,0.000000,0.000000
-4.460302,2.752790,-1.772847
0.000000,0.000000,0.000000
0.424784,3.885486,-1.129100
0.000000,0.000000,0.000000
-1.798531,1.855798,-2.944940
0.000000,0.000000,0.000000
4.609406,3.767244,-0.902053
0.000000,0.000000,0.000000
4.240137,0.112810,-4.983110
0.000000,0.000000,0.000000
3.316141,2.137958,-1.321065
0.000000,0.000000,0.000000
-0.966373,2.760020,-3.890192
0.000000,0.000000,0.000000
0.549883,0.681617,-1.764227
0.000000,0.000000,0.000000
-4.782592,1.427088,-1.333120
0.000000,0.000000,0.000000
4.756826,1.747087,-4.000419
0.000000,0.000000,0.000000
2.820212,2.665974,-2.196064
0.000000,0.000000,0.000000
4.241207,1.525606,-2.939514
0.000000,0.000000,0.000000
2.311113,3.825936,-1.161049
0.000000,0.000000,0.000000
-0.627248,1.193592,-0.800514
0.000000,0.000000,0.000000
2.171292,1.931242,-1.786782
0.000000,0.000000,0.000000
-4.122991,3.821580,-4.577572
0.000000,0.000000,0.000000
-0.949280,3.055109,-5.747253
0.000000,0.000000,0.000000
1.057466,1.484689,-1.340679
0.000000,0.000000,0.000000
-3.046628,1.056896,-5.339309
0.000000,0.000000,0.000000
-1.733377,3.906493,-0.708259
0.000000,0.000000,0.000000
3.726396,2.472665,-0.187315
0.000000,0.000000,0.000000
2.024721,2.273402,-3.454536
0.000000,0.000000,0.000000
1.634608,0.623423,-5.046981
0.000000,0.000000,0.000000
1.677818,1.256937,-3.139063
0.000000,0.000000,0.000000
1.191518,3.493788,-4.876855
0.000000,0.000000,0.000000
-0.188814,2.432363,-1.180047
0.000000,0.000000,0.000000
-0.904706,1.668010,-2.152478
0.000000,0.000000,0.000000
-2.754592,3.538901,-3.403086
0.000000,0.000000,0.000000
3.002704,1.819376,-1.585933
0.000000,0.000000,0.000000
-1.809146,0.526302,-4.324155
0.000000,0.000000,0.000000
4.621049,3.144659,-4.239485
0.000000,0.000000,0.000000
-3.495649,1.534036,-5.796707
0.000000,0.000000,0.000000
0.987535,2.106534,-0.176958
0.000000,0.000000,0.000000
3.682660,0.953753,-1.043513
0.000000,0.000000,0.000000
-4.294807,1.914387,-5.938526
0.000000,0.000000,0.000000
-2.023660,1.047331,-0.207321
0.000000,0.000000,0.000000
1.896571,1.504973,-2.507049
0.000000,0.000000,0.000000
4.597253,0.173905,-1.319065
0.000000,0.000000,0.000000
-0.909438,0.423796,-4.258822
0.000000,0.000000,0.000000
0.428424,0.045989,-2.303410
0.000000,0.000000,0.000000
-1.788164,0.231638,-2.265117
0.000000,0.000000,0.000000
4.149990,2.307798,-2.394797
0.000000,0.000000,0.000000
0.042384,1.213095,-3.083633
0.000000,0.000000,0.000000
0.306864,2.148186,-3.675517
0.000000,0.000000,0.000000
0.374269,0.921837,-0.897106
0.000000,0.000000,0.000000
-1.940155,3.832923,-2.929587
0.000000,0.000000,0.000000
4.569207,1.081575,-3.378994
0.000000,0.000000,0.000000
-4.245530,0.060847,-0.064171
0.000000,0.000000,0.000000
-2.006067,1.068979,-3.229504
0.000000,0.000000,0.000000
1.642737,2.260587,-1.472722
0.000000,0.000000,0.000000
-2.139425,3.897048,-1.580264
0.000000,0.000000,0.000000
3.338607,1.335040,-5.492668
0.000000,0.000000,0.000000
2.152215,1.821399,-3.098917
0.000000,0.000000,0.000000
-4.265283,0.724813,-5.508883
0.000000,0.000000,0.000000
-2.056181,1.460217,-4.886016
0.000000,0.000000,0.000000
-2.981384,1.248456,-5.127179
0.000000,0.000000,0.000000
-2.657006,0.487938,-2.349901
0.000000,0.000000,0.000000
-3.281757,0.692947,-5.434719
0.000000,0.000000,0.000000
-3.205624,1.359243,-2.956511
0.000000,0.000000,0.000000
2.947005,1.333783,-5.350085
0.000000,0.000000,0.000000
2.905306,2.679644,-4.789772
0.000000,0.000000,0.000000
-1.119820,3.836844,-4.144804
0.000000,0.000000,0.000000
2.407854,2.603909,-1.560979
0.000000,0.000000,0.000000
2.639601,2.710822,-0.998744
0.000000,0.000000,0.000000
2.506147,0.225546,-5.621994
0.000000,0.000000,0.000000
-3.091511,3.600041,-2.894244
0.000000,0.000000,0.000000
-2.077786,2.488547,-1.798297
0.000000,0.000000,0.000000
-0.028515,3.228177,-3.914598
0.000000,0.000000,0.000000
0.964911,2.783168,-0.673229
0.000000,0.000000,0.000000
4.213230,0.601488,-2.594209
0.000000,0.000000,0.000000
-1.232285,2.935244,-1.189208
0.000000,0.000000,0.000000
0.345220,2.627215,-1.380471
0.000000,0.000000,0.000000
1.478563,2.120227,-1.141197
0.000000,0.000000,0.000000
2.825537,1.676194,-0.114654
0.000000,0.000000,0.000000
-2.345435,2.492178,-5.978513
0.000000,0.000000,0.000000
0.505410,0.094016,-4.290851
0.000000,0.000000,0.000000
-1.444676,2.966019,-5.811096
0.000000,0.000000,0.000000
4.264731,0.060060,-5.079003
0.000000,0.000000,0.000000
-3.561983,3.294118,-4.536656
0.000000,0.000000,0.000000
-2.392059,3.813466,-4.995719
0.000000,0.000000,0.000000
-2.026737,2.230637,-2.334879
0.000000,0.000000,0.000000
2.936855,0.223929,-3.979904
0.000000,0.000000,0.000000
2.766805,0.634949,-3.461313
0.000000,0.000000,0.000000
-3.691507,2.742943,-5.696247
0.000000,0.000000,0.000000
2.833739,1.479939,-4.336356
0.000000,0.000000,0.000000
3.312504,3.442654,-4.743094
0.000000,0.000000,0.000000
-1.770088,2.186006,-1.413243
0.000000,0.000000,0.000000
2.379256,1.616136,-2.772141
0.000000,0.000000,0.000000
-2.984019,3.274140,-1.925932
0.000000,0.000000,0.000000
3.352034,2.632538,-4.434766
0.000000,0.000000,0.000000
-0.949882,3.900202,-1.385961
0.000000,0.000000,0.000000
-3.984846,2.079527,-4.770614
0.000000,0.000000,0.000000
1.036587,3.376867,-2.916273
0.000000,0.000000,0.000000
4.267012,3.851201,-2.866085
0.000000,0.000000,0.000000
0.885630,1.557594,-3.541080
0.000000,0.000000,0.000000
-2.622435,1.112746,-2.252925
0.000000,0.000000,0.000000
-1.558355,2.048280,-4.125010
0.000000,0.000000,0.000000
3.904520,3.338519,-2.196948
0.000000,0.000000,0.000000
-4.155986,0.860134,-4.107272
0.000000,0.000000,0.000000
-4.355138,2.513750,-0.226359
0.000000,0.000000,0.000000
2.759652,1.381487,-3.786592
0.000000,0.000000,0.000000
3.202870,2.923279,-4.405406
0.000000,0.000000,0.000000
2.668912,2.527436,-2.612376
0.000000,0.000000,0.000000
-3.671113,0.584287,-0.128001
0.000000,0.000000,0.000000
-1.550932,3.919569,-3.394460
0.000000,0.000000,0.000000
-2.225094,0.071221,-1.242552
0.000000,0.000000,0.000000
1.153240,0.405708,-2.019583
0.000000,0.000000,0.000000
2.584565,1.198981,-1.259006
0.000000,0.000000,0.000000
-1.602942,2.864540,-4.847428
0.000000,0.000000,0.000000
2.545400,1.929146,-4.673919
0.000000,0.000000,0.000000
Expert Answer
Answer to In Basic C (not C++, Java, or Python) And in visual studio (not Xcode): Assignment Description In this assignment, you’l… . . .
OR

