Please assist.  I want to add an array to my area calculation of a triangle

Yes, it compliles and runs,with just one set of integers, but I want to be able to calculate 3,4, 5 and 1,10, 2 as well using arrays. and I don't understand arrays enough to do this.
public class Heron{
private static void main (String [] args)
int a=3;
int b=3;
int c=3;
float s= (a+b+c)/2;
float y=s*((s-a)+(s-b)+(s-c));
if (s > a && s > b && s > c)
System.out.println ("The area of the triangle is " + Math.sqrt (y));
else
System.out.println ("Value=0");
}

public class Euclidean {
     static int [] triangle;
     private static void main (String [] args) {
         if(args.length == 0) {
             System.out.println("Specify length and height");
             System.exit(0);
         } else if(args.length % 2 != 0) {
             System.out.println("incorrect number of args!");
             System.exit(0);
         triangle = new int[args.length];
         for(int x = 0; x < args.length; x++) {
             triangle[x] = Integer.parseInt(args[x]);
         for(int i = 0; x < triangle.length; x++) {
             calc(triangle[x], triangle[x+1]);
             //System.out.println(x);
             x = x+1;
    public static void calc(int length, int height) {
         System.out.println("Length = " + length);
         System.out.println("Height = " + height);
         int area = (length * height) / 2;
         System.out.println ("The area of the triangle is " + area);

Similar Messages

Maybe you are looking for

  • How do I enable Task Panes in Acrobat 9 Pro?

    I'm trying to use Acrobat 9 Pro at work, and I'm repeatedly being given instructions on how to do various things that all involve the Task Pane(s). However, at some point on this machine I (or the person before me, since I haven't ever used Acrobat b

  • IPod continues to reboot nonstop.

    I followed the iTunes instructions word by word... my iPod, which was the first gen of the video iPods, keeps rebooting and showing the Apple logo. iTunes said it was successful updating the iPod however the iPod now keeps on rebooting with the Apple

  • Multiple re-do's?

    I got carried away and did more undos than I should have. Is there a way to do multiple re-dos, so I can go back to where I was? If not, I'm going to have to edit everything all over again, including oomplex effect attributes. Thanks

  • Can you find lost photos?

    I have lots of pictures in various libraries on the hard disk. I cannot search for them, and so I cannot get iPhoto to change libraries. If I could only search for the files in the iphoto library, I could find the libraries! Can you search for JPEG o

  • Usually this system rejects access using SSO tickets exception

    Hi, I'm facing a problem when trying to access to some tasks in the UWL. It appears an error message saying "Usually this system rejects the access using SSO tickets" (it's not an accurate translation, the message in spanish says "Generalmente este s