|
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
Due Sep.14 (Fri): Problems 1-9; only hardcopy is needed.
This week, part (a) will be accepted without penalty on Sep.17 (Mon).
Due Sep.17 (Mon): Problems 10-11, the html-documentation only (signatures, javadoc, and test cases). Turn in a hard-copy in class and also electronically submit (on WebCT) a copy of either the html file or the java file.
(Note that the javadoc has already been completed for you this week; although you can put a comment with an @author tag preceding the class declaration.)
Due Sep.19 (Wed): Problems 10-11, implementation (Java code). (If you turn it by Tuesday, it will be graded by Wednesday, in time for the exam.)
Note that you can consider this homework of studying for the exam.
2 + bob.gloopz( "Tuesday", false ) |
double roundTripTime( String url, int portNumber ) |
/** Given a number of cents, return a String for that amount in dollars, * including a preceding dollar-sign, * but using a (european-style) decimal-comma rather than a decimal-point. * @param cents An amount of money (in cents). * @return A String representing that amount, in dollars. Use a comma * for the decimal-separator. * Examples (assuming that `c` is a Cashier): * c.centsToStringEuroStyle(579) = "$5,79" * c.centsToStringEuroStyle( 43) = "$0,43" * c.centsToStringEuroStyle( ) = * c.centsToStringEuroStyle( ) = * c.centsToStringEuroStyle( ) = */ |
/** Respond to a donut order, at Oh Bonnie Pain. * @param nombreDonuts The number of donuts ordered. Non-negative. * @return A sophisticated-sounding message reporting the total price. * Tests (presuming `c` is a Cashier): * c.donutOrderrier( 10 ) = "10 sucrebombe donuts will cost $8,50. Merci!" * c.donutOrderrier( ) = * c.donutOrderrier( ) = */ |
Extra Credit: (4pts test cases/docs; 4pts code; due with part (c))
Write a function centsToString
which is more flexible than our above centsToStringEuroStyle:
It takes in two arguments:
a number of cents, and a decimal separator (a String).
Now, rewrite the body
of centsToStringEuroStyle with just one short line:
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
©2007, Ian Barland, Radford University Last modified 2007.Sep.19 (Wed) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |