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 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
Step: 1
The following code is written in CPP language Code Pa...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Java Programming
Authors: Joyce Farrell
9th edition
1337397075, 978-1337397070
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App