ABSTRACT

Our pay station company has been contacted by Lunatown that wants to buy our pay stations but they have a very peculiar requirement: the rate should be correlated to the phases of the moon. At full moon the rates should equal that of Alphatown while at new moon they should be doubled. In the period in between, the rate should proportionally vary between these extremes. Lunatown has provided us with a Java class for doing the calculation-the problem is that the interface of the class does not follow the conventions used in our own production code:

The parameter, amount, is a double and in dollars, not cents, and the method has a different name. Moreover, the class is not open source, and the municipality will not give us access to the source code as it belongs to a third-party company. However, it is very tempting to use the package instead of trying to figure out the astronomical calculations ourselves.