home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
lab03b
lab03b: finishing computeEbayFee
Complete the first two parts
of Wednesday's lab,
followed by the final (three-tier) step mentioned below,
in that order.
Be sure to
-
Have test cases and javadoc comments for both computeEbayFee
and wasAuctionProfitable.
-
Don't repeat code —
wasAuctionProfitable should call computeEbayFee
-
We won't be needing this for checking-off, this week.
Include NAMED_CONSTANTS as needed.
Named constants are those values which don't depend on the arguments.
We saw their use in Tuesday's highwayDrivingTime example.
(Hint: I'd call two of the named constants
RATE0 (for the lowest ebay commission rate, 5.25%)
THRESH0 (for the amount of a sale subject to that rate).)
-
New: Modify your program to complete the
challenge part of the lab (that is, including the three-tiered
fee structure).
But rather than using an
if-else
which contains another
if-else,
instead use the (conceptually very similar)
if-else-if
as shown in
Lecture's greet
example.
Be sure to include the curly-braces and good indentation!
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs