CS 305J Assignment, Using Loops
| Programming Assignment 3 | Individual Assignment. You must complete this assignment by
yourself. You cannot work with anyone else in the class or with someone
outside of the class. You are encouraged to get help from the instructional
staff. Placed online: Wednesday, September 10 |
||||
| Description | The purposes of this assignment are:
Complete a program named Rocket.java. The program is to produce the following output. /**\
/**\ Notice that the various subfigures in the middle of the original, smaller rocket, have a height of 3. These subfigures have the property that their height determines their width, so you only need one constant for the size of the rocket. You are to use a class constant to make it possible to change a single number in one place in the program to have it produce a corresponding figure of a different size. The larger rocket has a size of 7. This assignment is meant to give you practice with the constructs from chapters 1 and 2 of the textbook. (println and print statements, static methods, decomposition, loops, nested loops, and class / program constants) This will require you to create nested for loops with print and println statements that use the class constant. If you are interested, you may use the constructs from chapter 3, although you are not required to do so and you will receive no extra credit if you do. (Really, it is okay to not use parameters, and if you have never programmed before I strongly urge you to only use the concepts from chapters 1 and 2.) You may not use any programming constructs that are not in chapters 1 through 3 of the textbook. You should continue to use static methods to structure your solution. You should try to avoid significant redundancy and you should structure your program in such a way that the methods match the structure of the output itself. You are required to properly indent your source code and will lose points if your indenting is not readable and consistent You should localize variables whenever possible. This means try to minimize the number of class constants. You should only have one class constant, size, but you can have other variables declared locally in methods if you wish. Complete the comment at the beginning of your Rocket.java program. Include a comment for each method you write explain the purpose of that method. On any given execution your program will produce just one version of this figure, but it should be possible to change the value of the program constant to have your program produce a figure of a different size. For example, with subfigures of height 7, the figure would look exactly like the larger rocket shown above. When finished turn in your Rocket.java program using the turnin program. |
||||
| Files |
|
||||
| Checklist | Did you remember to:
Thanks to Stuart Reges for letting me use this assignment. |