Question: SUBJECT: PROGRAMMING FOR ENGINEER LANGUAGE: C++ (USING FUNCTION) ANSWER WITH DETAIL, TRUE AND PERFECT Coding Question: Triangle Construction (20 Marks) A text file, length.txt has

 SUBJECT: PROGRAMMING FOR ENGINEER LANGUAGE: C++ (USING FUNCTION) ANSWER WITH DETAIL,

SUBJECT: PROGRAMMING FOR ENGINEER

LANGUAGE: C++ (USING FUNCTION)

ANSWER WITH DETAIL, TRUE AND PERFECT

Coding Question: Triangle Construction (20 Marks) A text file, length.txt has the following information: length.txt 3 4 2 0 4 4 8 5 5 1 6 0 In a triangle, the sum of any two sided is always greater than the third side. Write a program that read the length of three lines from length.txt file. It then determines whether the three lines can be used to construct a triangle or not. If a triangle can be constructed, compute the area of the triangle. Note that the area of triangle can be calculated using the following formula, where a, b and c are the length of the sides; and s is calculated as follow Your program should perform all the following tasks: Check the existence of length.txt file Use loop to read the lengths from length.txt file and display the value Determine whether a triangle is possible or not If possible, calculate the area using calc_area() function (programmer-defined function) Display the area of triangle in main(). Set the display output to four decimal places of precision

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!