imma beginner and my iinstructur doesnt do hands on wit us we learn out of a lecture but it doesnt help some1 please help me
1. (The MyTriangle class) Write a class/program named MyTriangle. Within the class, define two methods as follows.
/** Returns true if the sum of ANY two sides is greater than the
third side. Otherwise, returns false. */
public static boolean isValid(double side1, double side2,
double side3)
/** Returns the area of the triangle */
public static double area(double side1, double side2,
double side3)
The formula for computing the triangle area based on the three sides is:
You are also required to write the main method in the MyTriangle class that reads three sides for a triangle from the user and checks whether it is a valid triangle (using the method isValid). If it is valid, the main method will compute the area (using the method area) and display it in the console. Otherwise, the main method will display a message stating that the triangle is not valid.
Note that you are REQUIRED to use console input and output for this assignment.
Hint:
1) In method area, calculate the value of s first. Then, apply the Math.sqrt method on the product of s, s-side1, s-side2 and s-side3.
2) You may use the solution for Programming Assignment 6 in WebCT as an example to check the validity of a triangle based on its three sides. Of course, you need to make it as a method now.
3) Use the Scanner class to obtain user inputs from the console. See programs TestScanner.java and ComputeLoanScanner.java in WebCT as examples.
4) Use System.out.println() to display the result in the console.