Starting from:
$35

$29

Assignment 01 Decomposition and Modularization Solution

For this assignment, you are to develop a Java program named DrawRockets.java that produces the exact output as shown to the right, depicting crude renderings of three rockets. First a small rocket then a medium rocket and finally a large rocket.

The given file, DrawRocketsPoor.java, is a Java program that produces the correct output. Although it is nicely formatted (i.e., its code is indented properly, with blank lines separating logically distinct code segments to improve readability) and includes appropriate comments, it is a poorly designed program.

This given program shows absolutely no evidence that the author/programmer employed the concepts of procedural decomposition and modularization. The program has a simplistic structure, and has many redundant instructions. Indeed, the body of the main method that actually "draws" the images is a sequence of highly redundant System.out.println() statements, similar to the equally bad DrawFigures1 program presented in Section 1.2 of the textbook.

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 (see Sections 1.4 and 1.5) in reworking the DrawFigures1 program to obtain first DrawFigures2 and then finally DrawFigures3. (You can download all of these Java programs from the AS01 folder on the Course Web Site, CWS.)

In the end, your program should include several methods, each of which "draws" some part of the figures to be output. Because there is much repetition within the figure, at least a few of your methods should be called multiple times during execution of the program. Ideally, no particular System.out.println() statement should appear more than once in your source program.

Once you think you have this assignment completed you are to use the form in the AS01 folder on the CWS the submit your source program file. The program must be named DrawRockets and the corresponding file submitted must be named DrawRockets.java.

Note that you can submit more than one time to the same folder. Hence, if, after submitting, you improve your program (e.g., by fixing logic errors or by enhancing your comments), you should submit the newer version with the same filename. Note that the folder will automatically version the earlier submissions with a timestamp. That is, within your submission folder, any previously submitted file having the same name will be renamed automatically (and still be accessible to both you and your instructor). Generally speaking, however, your instructor will normally examine only your most recent submission, unless you make an explicit request to the contrary.

Note the block of comments at the top of the given source program that presents identifying information about the program. The source program file you submit must include a similar block of comments, but with the particulars pertaining to your program. For your future use, the file Comments.java is provided as a template.

Good luck,

P.M.J.

More products