Question: b) Create a class named triangle. It takes cartesian coordinates for 3 corners of a triangle. The constructor calls a set function that accepts

b) Create a class named triangle. It takes cartesian coordinates for 3 corners of a triangle. The constructor

b) Create a class named triangle. It takes cartesian coordinates for 3 corners of a triangle. The constructor calls a set function that accepts three sets of coordinates and verifies that each of these is in the first quadrant with no single x- or y-coordinate larger than 30. Use the function distance() in part (a) to find the length of each side and then write a function named as area() to computer the area of triangle using following hero's formula. 73 6- A = s (s-a) s(sa) (sb) (s c) y 01 4- 3- 2- 1- 0 S (x, y) 1 d = c a+b+c 2 X 2 - X = a 3 4 (X2, Y) |y - Y1 = b 5 (X2, y1) 6 +X 7

Step by Step Solution

3.45 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The following code is written in CPP language Code Pa... View full answer

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 Programming Questions!