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

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 ellipsoidList;

/** * build a TriangleList object. constructor. * * @param listIn for listName * @param ellipsoidListIn for ellipsoidList */ public EllipsoidList(String listIn, ArrayList ellipsoidListIn) { list = listIn; // buid=ld new list ellipsoidList = new ArrayList(); //copy input to instance variable for(Ellipsoid e : ellipsoidListIn) { ellipsoidList.add(e); } }

//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 getList() { return ellipsoidList; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!