Hello, I can compile this code, but I cannot run it. I get this message: No main
Question:
Hello,
I can compile this code, but I cannot run it. I get this message: No main method, JavaFX application, applets or midlets found in file. I am not sure that this means. Please see below. Please help.
import java.text.DecimalFormat; import java.util.ArrayList;
public class EllipsoidList { private String list; private ArrayList
/** * build a TriangleList object. constructor. * * @param listIn for listName * @param ellipsoidListIn for ellipsoidList */ public EllipsoidList(String listIn, ArrayList
//methods /** * @return the list name */ public String getName() { return list; //// }
/** * @return the list name */ public int numberOfEllipsoids() { return ellipsoidList.size(); }
/** * @return the list name */ public double totalVolume() { double total = 0; //use for each loop for(Ellipsoid e : ellipsoidList) { if(e != null) { total += (e.volume()); } } // return the total volume return total; }
/** * counts the total. * * @return totalSurfaceArea */ public double totalSurfaceArea() { double total = 0; //use for each loop for(Ellipsoid e : ellipsoidList) { if(e != null) { total += (e.surfaceArea()); } } return total; }
/** * finds. * * @return averageVolume */ public double averageVolume() { if(this.numberOfEllipsoids() == 0) { return 0; } else { return this.totalVolume() / this.numberOfEllipsoids(); } }
/** * finds. * * @return averageSurfaceArea */ public double averageSurfaceArea() { if(this.numberOfEllipsoids() == 0) { return 0; } else { return this.totalSurfaceArea() / this.numberOfEllipsoids(); } }
/** * gets a summary of the ellipsoid in the list. * * @return summaryInfo */ public String toString() { String result = getName() + " "; int index = 0; while (index < ellipsoidList.size()) { result += " " + ellipsoidList.get(index) + " "; index++; } return result; }
/** * gets a summary of the ellipsoid in the list. * * @return summaryInfo */
public String summaryInfo() { DecimalFormat decFt = new DecimalFormat("#,##0.###"); String result = ""; result += " "; result += "---- Summary for " + getName() + "----"; result += " Number of Ellipsoid Objects: " + numberOfEllipsoids(); result += " Total Volume: " + decFt.format(totalVolume()) + " cubic units"; result += " Total Surface Area: " + decFt.format(totalSurfaceArea()) + " square units"; result += " Average Volume: " + decFt.format(averageVolume()) + " cubic units"; result += " Average Surface Area: " + decFt.format(averageSurfaceArea()) + " square units"; return result; }
public ArrayList
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill