Create a header file named MyTriangle.h that contains the following two functions:
// return true if the sum of any two sides is greater than the third side//
bool isValid( double side1, double side2, double side3)
//Return the area of a triangle//
double area (double side1, double side2, double side3)
Implement the header file and write a test program that reads three sides of a triangle and compute the area if the input is valid. Otherwise display the input is invalid.
The formula is as follows:
s = (side1 + side2 + side3) / 2;
area = √(s (s-side1)(s-side2)(s-side3))
1
Expert's answer
2012-11-21T09:44:47-0500
#pragma once class MyTriangle { public: MyTriangle(void); ~MyTriangle(void); // return true if the sum of any two sides is greater than the third side// bool isValid( double side1, double side2, double side3) ; //Return the area of a triangle// double area (double side1, double side2, double side3); };
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment