Campbell Ritchie wrote:I can't see any relation between that code and the question you posted. It must be in different code. One thing I can see is far too much code in the main() method.
It says here that the writeOutput() should display this:
You are purchasing 3 shoes at 1999.50 each.
Tim Holloway wrote:UML was an absolute "must have" back around the beginning of the Millennium, but I'm not sure how popular it is any more. UML diagrams are great if you want to wallpaper a cubicle with acres of printout, but they don't illustrate relative importance of the objects that they define and they don't have any indication as to what the object methods and properties they illustrate are actually good for aside from whatever you can infer from their names.
So what we have is that you've been given the template for an un-named Java class (or classes) and it sounds like there were additional specs we haven't seen. So we can supply suggestions, but not very good ones. For that we need more information.
Does anybody miss it?
Tim Holloway wrote:. . . I'm not sure how popular it is any more. . . .
Jesse Silverman wrote:... if approached as some kind of High Ceremony Religion, UML can be worse than useless.
Jesse Silverman wrote:...
If it is used selectively and thoughtfully in the ways and places that it clarifies understanding, including what is helpful to this end and excluding what is not and just clutters, it can be a great tool to help show organizations and relationships, and give visuals of various kinds of selected details that don't jump out as well from code.