![]() |
![]() |
|
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
class EbayExpert {
/** This function, computeEbayFee, ... does what, briefly?
* @param ________ _______________
* @param ________ _______________
* @return _____________________.
* Some test cases:
* computeEbayFee( ____, ____ ) = _____
* computeEbayFee( ____, ____ ) = _____
* computeEbayFee( ____, ____ ) = _____
* computeEbayFee( ____, ____ ) = _____
*/
______ computeEbayFee( ______ salePrice, _______ usedGallery ) {
/* We'll put some NAMED_CONSTANTS here later, for part 3 of the lab. */
/* Compute a sub-result of our overall answer, using a local variable: */
double feeForGallery; // Whether we charge 0 or 0.35 depends on
if ( ______ ) { // whether the gallery-option was actually used.
feeForGallery = ______;
}
else
feeForGallery = ______;
}
/* Compute a sub-result of our overall answer, using a local variable: */
double finalValueFee;
/* What will we initialize this local variable to?
* An 'if' statment seems plausible...1
*/
/* Compute a sub-result of our overall answer, using a local variable: */
double flatListingFee = ______; // We can declare and initialize all on one line!
/* Hmm, should this be a NAMED_CONSTANT, instead? */
return ____________________;
}
}
|
1 Math-whizzes might find a formula which doesn't involve 'if', but Math.max and Math.min instead! ↩
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
| ©2007, Ian Barland, Radford University Last modified 2007.Aug.27 (Mon) |
Please mail any suggestions (incl. typos, broken links) to ibarland |
![]() |