Write a complete program to read 3 sets of 3 double numbers (9total) that are th
ID: 3611145 • Letter: W
Question
Write a complete program to read 3 sets of 3 double numbers (9total) that are the vertices of a 3-D triangle from the indicateddata file - one triangle per line, find the area of each triangleusing Herod's formula or another standard formula and in yourcomments state why you are using your selected formula, find andoutput the smallest triangle and its line number, the largesttriangle and its line number, the most horizontal triangle and itsline number and in your comments how you determined a triangle washorizontal, find and output the average triangle area, and finallythe number of triangles read in. The maximum number of triangles is10,000. For bonus points, determine the most vertical triangle and itsline number and in your comments clearly state how you deteminedthe most vertical one. Output is to both the screen and to the data file named"output5.dat" only. There will be several input data files fortesting your program. Herod's Forumla: If "a", "b", "c" are the sides of a triangle, then "s = (a + b+ c) / 2" is a temporary variable used in this formula: area = sqrt[s(s - a)(s - b)(s - c)] Write a complete program to read 3 sets of 3 double numbers (9total) that are the vertices of a 3-D triangle from the indicateddata file - one triangle per line, find the area of each triangleusing Herod's formula or another standard formula and in yourcomments state why you are using your selected formula, find andoutput the smallest triangle and its line number, the largesttriangle and its line number, the most horizontal triangle and itsline number and in your comments how you determined a triangle washorizontal, find and output the average triangle area, and finallythe number of triangles read in. The maximum number of triangles is10,000. For bonus points, determine the most vertical triangle and itsline number and in your comments clearly state how you deteminedthe most vertical one. Output is to both the screen and to the data file named"output5.dat" only. There will be several input data files fortesting your program. Herod's Forumla: If "a", "b", "c" are the sides of a triangle, then "s = (a + b+ c) / 2" is a temporary variable used in this formula: area = sqrt[s(s - a)(s - b)(s - c)]Explanation / Answer
please rate - thanks this should get you started #include #include #include double findslope(double,double,double,double); double getarea(double,double,double); double findline(double,double,double,double); int main() {double side1[3],side2[3],side3[3],area[3],; double x[3][3],y[3][3],slope1[3],slope2[3],slope3[3],small; int i,j,smallindex; ifstream in; in.open("text.txt"); //open file if(in.fail()) //is it ok? { couty[i][j]; //3 triangles index i 3 points per triangle -index j for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.