Question: My EllipsoidList.java cannot compiled. I get the following message: EllipsoidList.java:247: error: cannot find symbol and EllipsoidList.java:250: error: incompatible types: boolean cannot be converted to Ellipsoid.

My EllipsoidList.java cannot compiled. I get the following message: EllipsoidList.java:247: error: cannot find symbol and EllipsoidList.java:250: error: incompatible types: boolean cannot be converted to Ellipsoid. Also compile error is connected to:

if (e != null) { e.setA(aIn); e.setB(bIn); e.setC(cIn); return true; } return false; } }

Please let me know what I am missing. EllipsoidList code below.

import java.text.DecimalFormat; import java.util.ArrayList; import java.io.FileNotFoundException; import java.util.Scanner;

/** Program that uses the ArrayList to find a summary of an Ellipsoid. * * @Author: Ronald Funes * @version: 02/28/2023 */ public class EllipsoidList { private String list; private ArrayListellipsoidList; /** * Create a TriangleList object constructor. * @param listIn for listName * @param ellipsoidListIn for ellipsoidList */ public EllipsoidList(String listIn, ArrayListellipsoidListIn) { list = listIn; ellipsoidList = new ArrayList(); for (Ellipsoid e: ellipsoidListIn) { ellipsoidList.add(e); } } /** Finds the list. * @return the list name */ public String getName() { return list; } /** Finds the ellipsoid size. * @return the list name */ public int numberOfEllipsoids() { return ellipsoidList.size(); } /** Finds the volume. * @return the list name */ public double totalVolume() { double total = 0; for (Ellipsoid e : ellipsoidList) { if (e != null) { total += (e.volume()); } } return total; }

/** * counts the total. * @return totalSurfaceArea */ public double totalSurfaceArea() { double total = 0; for (Ellipsoid e : ellipsoidList) { if (e != null) { total += (e.surfaceArea()); } } return total; } /** * finds volume. * @return averageVolume */ public double averageVolume() { if (this.numberOfEllipsoids() == 0) { return 0; } else { return this.totalVolume() / this.numberOfEllipsoids(); } }

/** * finds surface area. * @return averageSurfaceArea */

public double averageSurfaceArea() { if (this.numberOfEllipsoids() == 0) { return 0; } else { return this.totalSurfaceArea() / this.numberOfEllipsoids(); } } /** Gets summary and finds string. * @return summaryInfo */ public String toString() { String result = getName() + " "; int index = 0; while (index < ellipsoidList.size()) { result += " " + ellipsoidList.get(index) + " "; index++; } return result; }

/** Gets result of ellipsoid and states summary. * @return summaryInfo */ public String summaryInfo() { DecimalFormat df = new DecimalFormat("#,##0.###"); String result = ""; result += " "; result += "----Summary for " + getName() + "----"; result += " Number of Ellipsoid Objects: " + numberOfEllipsoids(); result += " Total Volume: " + df.format(totalVolume()) + "cubic units"; result += " Total Surface Area: " + df.format(totalSurfaceArea()) + "square units"; result += " Average Volume: " + df.format(averageVolume()) + "cubic units"; result += " Average Surface Area: " + df.format(averageSurfaceArea()) + "square units"; return result; } /** Uses ArrayList to return the ellipsoidList. * @return ellipsoidList */ public ArrayListgetList() { return ellipsoidList; } /** Find the methods. * @param filename identified * @return bull if empty */ public static EllipsoidList readFile(String filename) { try { Scanner infile = new Scanner(filename); EllipsoidList elist = new EllipsoidList(infile.nextLine(), new ArrayList()); while (infile.hasNext()) { elist.addEllipsoid(infile.next(), infile.nextDouble(), infile.nextDouble(), infile.nextDouble()); } infile.close(); return elist; } catch (FileNotFoundException elist) { System.out.println(elist.getMessage()); } return null; } /** Gets the results. * @param a for label a * @param label identified * @param b for label b * @param c for label c */

public void addEllipsoid(String label, double a, double b, double c) { ellipsoidList.add(new Ellipsoid(label, a, b, c)); } /** New method added. * @param label used * @return null if not found */ public Ellipsoid findEllipsoid(String label) { for (Ellipsoid e : ellipsoidList) { if (e.getLabel().equalsIgnoreCase(label)) { return e; } } return null; } /** Delete the ellipsoid method. * @param label used * @return e for Ellipsoid */ public Ellipsoid deleteEllipsoid(String label) { Ellipsoid e = findEllipsoid(label); if (e != null) { ellipsoidList.remove(e); } return e; } /** Edits the ellipsoid. * @param a as part of editEllipsoid * @param b as part of editEllipsoid * @param c as part of editEllipsoid * @return boolean */ public Ellipsoid editEllipsoid(String a, double b, double c) { Ellipsoid e = editEllipsoid(a, b, c); if (e != null) { e.setA(aIn); e.setB(bIn); e.setC(cIn); return true; } return false; } }

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 Databases Questions!