*JAVA
Design a class to perform the function as follows:
O double area triangle (double a, double b, double c) with three double arguments, returns the area of a scalene triangle using the formula
area = V(s(s - a)(s - b)(s - c))
where s = (a + b + c)/2
(O static double area trap(int a, int b, int height) with three integer
arguments, returns the area of a trapezium using the formula:
area = 1/2 x height x (a + b)
(1) double area double diagonall, double diagonal2) with two double arguments, returns the area of a rhombus using the formula: area = 1/2 x (diagonalt x diagonal2.
Answers
Answered by
0
Answer:
Design a class to overload a function area( ) as follows: (i) double area (double a, double b, double c) with three double arguments, returns the area of a scalene triangle using the formula: area = where (ii) double area (int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula: area = 2 height (a + b) (iii) double area (double diagonal 1, double diagonal 2) with two double arguments, returns the area of a rhombus using the formula : area = (diagonal 1 x diagonal 2)Read more on Sarthaks.com - https://www.sarthaks.com/838056/design-a-class-to-overload-a-function-area-as-follows
Similar questions