(Solved) : Write Program Allow User Calculate Area Triangle Table 1 Lists Different Options User Depe Q37273630 . . .
write a C program…the main and the triangleCalculator.h

Write a program that will allow the user to calculate the area of a triangle. Table 1 lists the different options the user will have depending on the information available for the triangle. The three sides of the triangle Side, angle, side Side, side, angle Angle, side, angle Angle, angle, side Coordinates of the three vertices Your program must include a user-defined library called “triangleCalculator.h”. This library will have all the user-defined functions needed to make the calculations I have provided you with general description of what the functions should accomplish and their name. You will have to properly choose the return and input data types. Your solution must include all the functions that I have listed but you may add more. If you need help on how to make some of these calculations and/or test your results go this website In some of the functions you will need to use trigonometry functions such as sine and cosine or the arc functions. Remember that the C math library contains such functions, however their inputs and results are in radians. In your program the user will enter the value of an angle in degrees. Make sure that your program takes care of these conversion where necessary. The user will be able to make as many calculations as desired. I. Distance between two points (also the hypotenuse of a right triangle) distance(x1, y1, x2, y2) a. i. Given two end-point coordinates the function will calculate and return the distance between the points. Il. Check that 3 lengths will form a triangle isTrianglefside1, side2, side3) Given three sides this function will determine whether the sides form a triangle or not. The function will return a. i. 1 when the sides form a triangle ii. -1 when the condition side2side3 s side1 is not met iii. -2 when the condition side1side3 S side2 is not met iv. 3 when the condition sidelside2 S side3 is not met III Calculate the third side of a triangle a. side3(side1, side2, angle) The function will return the value of the third side of the triangle, when the third side can’t be calculated it will retun-1 IV. The area of a triangle a. areaSSS (side1, side2, side3) i. Given the three sides of a triangle (SSS) the function will calculate and returm the area of the triangle. When the area of a triangle can’t be calculated the function will display a message and return-1 b. areaSAS(side1, angle, side2) i. Given two sides and the included angle (SAS) the function will calculate and return the area of the triangle. areaSSA(side1, side2, angle) c. i. Given two sides and an angle that is not between the sides (SSA) the function will calculate and return the area of the triangle d. areaASA(angle1, side1, angle2) i. Given two angles and a side in-between (ASA) the function will calculate and return the area of the triangle. e. areaAAS(angle1, angle2, side1) i. Given two angles and a side not between (AAS) the function will calculate and return the area of the triangle. Show transcribed image text Write a program that will allow the user to calculate the area of a triangle. Table 1 lists the different options the user will have depending on the information available for the triangle. The three sides of the triangle Side, angle, side Side, side, angle Angle, side, angle
Angle, angle, side Coordinates of the three vertices Your program must include a user-defined library called “triangleCalculator.h”. This library will have all the user-defined functions needed to make the calculations I have provided you with general description of what the functions should accomplish and their name. You will have to properly choose the return and input data types. Your solution must include all the functions that I have listed but you may add more. If you need help on how to make some of these calculations and/or test your results go this website In some of the functions you will need to use trigonometry functions such as sine and cosine or the arc functions. Remember that the C math library contains such functions, however their inputs and results are in radians. In your program the user will enter the value of an angle in degrees. Make sure that your program takes care of these conversion where necessary. The user will be able to make as many calculations as desired.
I. Distance between two points (also the hypotenuse of a right triangle) distance(x1, y1, x2, y2) a. i. Given two end-point coordinates the function will calculate and return the distance between the points. Il. Check that 3 lengths will form a triangle isTrianglefside1, side2, side3) Given three sides this function will determine whether the sides form a triangle or not. The function will return a. i. 1 when the sides form a triangle ii. -1 when the condition side2side3 s side1 is not met iii. -2 when the condition side1side3 S side2 is not met iv. 3 when the condition sidelside2 S side3 is not met III Calculate the third side of a triangle a. side3(side1, side2, angle) The function will return the value of the third side of the triangle, when the third side can’t be calculated it will retun-1 IV. The area of a triangle a. areaSSS (side1, side2, side3) i. Given the three sides of a triangle (SSS) the function will calculate and returm the area of the triangle. When the area of a triangle can’t be calculated the function will display a message and return-1 b. areaSAS(side1, angle, side2) i. Given two sides and the included angle (SAS) the function will calculate and return the area of the triangle. areaSSA(side1, side2, angle) c. i. Given two sides and an angle that is not between the sides (SSA) the function will calculate and return the area of the triangle d. areaASA(angle1, side1, angle2) i. Given two angles and a side in-between (ASA) the function will calculate and return the area of the triangle. e. areaAAS(angle1, angle2, side1) i. Given two angles and a side not between (AAS) the function will calculate and return the area of the triangle.
Expert Answer
Answer to Write a program that will allow the user to calculate the area of a triangle. Table 1 lists the different options the us…
OR