p
2
s=p(pa) (pb)(p - c)
and you can use the square root function like this:Math.sqrt(). If a, b, c are invalid sides of the triangle then return 0
toString(): String - return a string format of the triangle such as: color,a,b,c with a, b, c are formatted
in two decimal places
The Main class is provided for you in binary form. You only test your program by running the binary file. There are several test cases for you, as follows:
Enter the first edge:3.445
Enter the first edge:1
Enter the second edge:2
Enter the second edge:4.6554 Enter the third edge:5.9722
Enter the third edge:3
Enter the color: Red
1.Test ValidData
Enter the color:red
1.Test ValidData
2. Test calPerimeter
2. Test calPerimeter
3. Test calArea
3. Test calArea
Enter your choice(1/2/3):1
Enter your choice(1/2/3):1
OUTPUT:Red,3.45,4.66,5.97
OUTPUT:Invalid
4 of 5 Paper No: 1
Enter the first edge:3 Enter the second edge:4
Enter the first edge:8 Enter the second edge:8
Enter the third edge:5 Enter the color: Red
Enter the third edge:8 Enter the color:Red
Close
+ 93%