Question
edit Ellipsoid : Takes four parameters ( label, a, b, and c ), uses the label to find the corresp onding the Ellipsoid object .
edit
Ellipsoid
: Takes
four
parameters (
label,
a, b, and
c
), uses the label to find the
corresp
onding the
Ellipsoid
object
. If found, sets the
a, b, and c
to the values passed in as
parameters, and returns
the Ellipsoid object
. If not found, returns
null
.
This method
should
not
change the label
.
public boolean editEllipsoid(String labelIN, double aIN, double bIN, double cIN) { Ellipsoid result = null; int index = 0; for (Ellipsoid h : tList) { if (h.getLabel().equalsIgnoreCase(labelIN)) { index = tList.indexOf(h); break; } } if (index >= 0) { findEllipsoid(labelIN).setA(aIN); findEllipsoid(labelIN).setB(bIN); findEllipsoid(labelIN).setC(cIN); return true; } return false; }
my reviewer program says
error: incompatible types: boolean cannot be converted to Ellipsoid Ellipsoid actual = list.editEllipsoid("abcdefg", 1,2,3);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started