+-----------------------+ |#######################| |#######################| +-----------------------+ | | | | +-------+-------+-------+ | | | | +-------+-------+-------+ | | | | +-------+-------+-------+ | | | | +-------+-------+-------+ | | | | +=======+=======+=======+ | | | | +-------+-------+-------+ | | | | +-------+-------+-------+ | | | | +-------+-------+-------+ | | | | +-------+-------+-------+ | | | | +-----------------------+ |#######################| |#######################| +-----------------------+ |
Question: In what sense is it poorly designed?
Answer: It shows absolutely no evidence that the author/programmer
employed the concepts (namely, procedural decomposition,
capturing structure, and eliminating redundancy)
presented in Sections 1.4 and 1.5 of our textbook
(Building Java Programs, by Reges & Stepp).
Indeed, the program consists of only a main() method
containing 30+ System.out.println() statements,
similar to the equally bad DrawFigures1 program in
Section 1.2 of the textbook (and accessible via the course web page).
Your goal is to transform the given program into one that is well designed. As a model, follow the same train of thought that guided Reges and Stepp in reworking the DrawFigures1 program to obtain first DrawFigures2 and then finally DrawFigures3. (Again, see Sections 1.4 and 1.5.)
In the end, your program should include several methods, each of which "draws" some part of the field. Because there is much repetition within the figure, a few —and maybe even several— of your methods should be called multiple times during execution of the program. (One such method might be drawEndZone(), as there are two end zones. Another might be drawLineWithHashMarks(), as there are eight identical lines with hash marks on the field.)
Submit your source code file (the name of which must be FootballField.java) to the appropriate dropbox in Brightspace. Do not submit the .class file.) Make sure to include comments in your program identifying yourself, indicating that it is a solution to CMPS 134's Prog. Assg. #1, acknowledging any persons who aided you in developing your solution, and pointing out any flaws of which you are aware. (These comments should be placed just above the class heading; use the program given to you as a template.)
Be aware that you can submit more than one time. Hence, if, after submitting, you improve your program (e.g., by fixing logic errors or removing more redundancy), you should submit the newer version. Do not use a new file name every time you submit. Rather, use the same name each time: FootballField.java. Generally speaking, only your last submission will be examined by your instructor. Hence, if you wish him to view earlier submissions, too, you need to specifically ask.