sup ya'll, i've been doing this Triangle class homework for a couple of days and have ended up having to change how i am attacking it like 2wice but anyway. i've hit the last wall i think i can hit. this code is all wrong & i don't even know why. i should know, but the semester is almost up & i'm fragged. please help with any hints tips, etc. i don't want you guys to do it for me but instead show me my many errors & a path to make the program work. please...
thanx
>>!?!
import javax.swing.JOptionPane;
public class Triangle extends GeometricObject
{
//get the sides first
double side;
double side1 = 1.0;
double side2 = 1.0;
double side3 = 1.0;
double[] numbers = new double[];
public Triangle()
{
}
public static void main(String[] args) {
String Str1 = JOptionPane.showInputDialog("Enter side 1");
double side1 = Double.parsedouble(Str1);
String Str2 = JOptionPane.showInputDialog("Enter side 2");
double side2 = Double.parsedouble(Str2);
String Str3 = JOptionPane.showInputDialog("Enter side 3");
double side3 = Double.parsedouble(Str3);
Triangle t = new Triangle();
JOptionPane.showMessageDialog(null, result );
}
public Triangle(double side1, double side2, double side3)
{
this.side1 = side1;
this.side2 = side2;
this.side3 = side3;
}
//get the area
public double getArea()
{
return radius * radius * Math.PI;
}
//get the perimeter
public double getPerimeter()
{
return 2 * radius * Math.PI;
}
public String toString()
{
return "Triangle: side1 = " + side1 + "side 2 = " + side2 + "side 3 = " + side3;
}
public String getType()
{
if(side[1] == side[2] | side[1] == side [3] | side[2] == side[3])
{
if(side[1] == side[2] & side[2] == side[3]) type = "Equilateral";
else type = "Isosceles";
}
else
{
type = "Scalene";
}
return type;
}
}