Write a program Spheroid.java that takes respectively parameters a and c as command-line arguments and calculates surface area of an oblate spheroid.
He gave us the formulas to use but when I run it with his example command line arguments I get something totally different. His example gives 6 and 5 and gets 403.050. I did what I thought was correct and got 546.1380388013903. I haven't attempted to round it yet, I just wanted to see if I was close.
public class Spheroid {
public static void main(String[] args){
String a = args[0];
String c = args[1];
Double A = Double.parseDouble(a);
Double C = Double.parseDouble(c);
Double e;
Double S;
e = Math.sqrt(1-(Math.pow(C, 2)/Math.pow(A, 2)));
S = (2 * Math.PI * Math.pow(A, 2)) + (Math.PI * ((Math.pow(C, 2)/ Math.pow(e, 2))) * (Math.log((1+e)/(1-e))));
System.out.println(S);
}
}