Getting the rest of this to work.
Hey earlier today i posted a fragment of this code, but now im down to the completion of the program. I just need some tips on asking the user for system input for two values. Do i have to make two different system.out.prinln inputs for each set of vertex values, or can i do it all in 1 line. im reffering to this line.
String vertex;
System.out.println("Enter the vertex (x, y) as two numbers with a space between them:");
vertex= keyboard.readToken();
This is where the program starts.
import chn.util.*;
class Triangle
{
double computeDistance (int x1,int y1,int x2,int y2)
{
double blah,blah2;
blah= (x1-x2)*(x1-x2);
blah2= (y1-y2)*(y1-y2);
return blah;
}
double computeAngle (double a,double b,double c)
{
double angleA,angleB,angleC,acos;
angleA = ((b*b + c*c - a*a) / 2*(b*c));
angleB = ((a*a + c*c - b*b) / 2*(a*c));
angleC = ((a*a + b*b - c*c) / 2*(a*b));
return angleA;
}
double radianToDegrees (double radians)
{
double rod;
rod=180*radians/ 3.14986736792793420;
return rod;
}
float computeArea (double a,double b,double c)
{
double s,A;
s = 1/2*(a+b+c);
A = s*((s-a)*(s-b)*(s-c));
return A;
}
void triangleOutput (int x1,int y1,int x2,int y2,int x3,int y3,
double a,double b,double c,
double angle1,double angle2,double angle3,double area)
{
}
}
// End of Triangle class
publicclass TriangleStats
{
publicstaticvoid main (String[ ] args)
{
ConsoleIO keyboard =new ConsoleIO();
Triangle myTriangle =new Triangle( );
String vertex;
System.out.println("Enter the vertex (x, y) as two numbers with a space between them:");
vertex= keyboard.readToken();
}
}

