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

Display all results using 12 decimal places, so that the default precision for c

ID: 3628549 • Letter: D

Question

Display all results using 12 decimal places, so that the default precision for cout will not mask rounding errors.


USE
# include
<iostream>    

using namespace std;

int main ()          

{

     return 0;           

}


Thanks in advance!


i just do not understand what they are asking, so if i had direction, it would be awesome.   thanks

Explanation / Answer

They want you to output the area of the quadrilateral in three different ways. First you must prompt the user for the for points (cout > x1 >> y1), etc. Output the first area using this equation: .5 * (abs( (x1y2 - x2y1) + (x2y3 - x3y2) + (x3y4 - x4y3) + (x4y1-x1y4) ) ) Second, theoretically split the quadrilateral into two triangles with a dividing line going from 1 to 3. Use Heron's formula to calculate the area of each triangle separately, then add them together. Last, split the quadrilateral into two triangles with a line from 2 to 4 and use Heron's formula again. Output all of these areas.