Question: java QUESTION 2 (25 points): The area of an equilateral triangle is computed as follows (given that all sides have length a): (a) a a

java
QUESTION 2 (25 points): The area of an equilateral triangle is computed as follows (given that all sides have length a): (a) a a Complete the code below (i.e., copy/paste into new files called Area Program.java and AreaProgramTest.java) to compute the area of the triangle. Test your code to see whether it is correct. When a=1 the area is around 0.433, when a=5 the area is around 10.825. public class Area Program { double a; double area; public double computeArea() { // compute the area } } public class AreaProgramTest { public static void main(String args[]) { Area Program area Program = new Area Program(); System.out.println("The area is "+area Program.computeArea()); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
