|
home—info—lects—labs—exams—hws
tutor/PIs—Object120 + its docs—java.lang docs—java.util docs
/** A class with functions for computing various eBay fees. * See http://www.radford.edu/~itec120/2010fall-ibarland/Labs/lab04b.html * * @author _______________ * @author _______________ */ class EbayExpert { /** This function, totalEbayFee, ... does what, briefly? * @param ________ _______________ * @param ________ _______________ * @return _____________________. */ static ______ totalEbayFee( ______ salePrice, _______ usedGallery ) { /* Compute a sub-result of our overall answer, using a local variable: */ double feeForGallery; // Whether we charge 0 or 1.00 depends on //initialize feeForGallery // whether the gallery-option was actually used. /* Compute a sub-result of our overall answer, using a local variable: */ double finalValueFee; /* What will we initialize this local variable to? * It's complicated enough that we'll have a separate function!, * and just call that to figure out what to initialize finalValueFee to. */ /* Compute a sub-result of our overall answer, using a local variable: */ double insertionFee = ______; // We can declare and initialize all on one line! /* Hmm, should this be a NAMED_CONSTANT, instead? */ return ____________________; } static void testEbayExpert() { System.out.println( "Just the final value fee for a $5 item with no gallery picture:" ); System.out.println( "Actual: " + computeFVFee( ____ )); System.out.println( "Expect: " + ____ ); // several more test cases! System.out.println( "Total fee for a $5 item with no gallery picture:" ); System.out.println( "Actual: " + totalEbayFee( ____, ____ ) ); System.out.println( "Expect: " + ____ ) ); // more test cases (presumably parallel to the ones for computeFVFee) } // Your code for computeFVFee here } |
home—info—lects—labs—exams—hws
tutor/PIs—Object120 + its docs—java.lang docs—java.util docs
©2010, Ian Barland, Radford University Last modified 2010.Sep.30 (Thu) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |