CIS 201 Assignment 4: The Rocket

This assignment was developed and written by Stuart Reges, University of Washington and Marty Stepp, University of Washington, Tacoma.

Due: Wednesday, Feb 24, class time

Description

This program tests your understanding of expressions and variables, for loops, and global constants, and also reinforces your previous material on static methods and println statements. You should write a Java class called Rocket that should be saved into a file called Rocket.java. Your program should produce the following "rocket ship" figure as output:
     /||\
    //||\\
   ///||\\\
  ////||\\\\
 /////||\\\\\
+-*-*-*-*-*-*+
|../\..../\..|
|./\/\../\/\.|
|/\/\/\/\/\/\|
|\/\/\/\/\/\/|
|.\/\/..\/\/.|
|..\/....\/..|
+-*-*-*-*-*-*+
|\/\/\/\/\/\/|
|.\/\/..\/\/.|
|..\/....\/..|
|../\..../\..|
|./\/\../\/\.|
|/\/\/\/\/\/\|
+-*-*-*-*-*-*+
     /||\
    //||\\
   ///||\\\
  ////||\\\\
 /////||\\\\\
You should reproduce the format of this output exactly. This includes having identical characters and spacing. One way to write a Java program to draw this figure would be to write a System.out.println statement that prints each line of the rocket. However, this solution will receive NO credit. A major part of this assignment is showing that you understand for loops; therefore, in lines that have repeated patterns of characters that vary in number from line to line, represent the lines and character patterns using appropriate nested for loops. (The Hourglass program in Chapter 2's case study is a good example of this.) It may help you to write pseudo-code and tables to understand the patterns in the output, as described in the textbook and lecture.

Another significant component of this assignment is the task of generalizing the program using a global constant that can be changed to adjust the size of the rocket ship.

Stylistic Guidelines

The following are the criteria on which you will be graded:

Submission Requirements

  1. Once you have your program working correctly and commented, print a hard (paper) copy of Rocket.java for submission.

  2. You must also submit this same file electronically.
    1. Make sure that the file is on our lab system in Dunn 358. If you did your work there, this is no problem. Otherwise, have your assignment on a USB drive and put it in your account. Your program must compile and run correctly on the lab system. That is where it will be graded.
    2. If you discover after submission that you want to change your program and then resubmit, you may do so using the same submit command. The new program will then replace the old.
  3. If you wish to double check that your submission succeeded, enter this command (replacing the xxxx with your own login name):
        
            more /home/student/Submit/201/xxxx/Rocket.java
         
    This goes to the submission location and displays the copy of your program found there.

Grading Criteria

Your program MUST compile ERROR FREE to receive any credit! Your program MUST use for loops to receive any credit.
Correct submission of project (both electronic and hard copy) 3 pts
Correct program behavior 9 pts
Program uses a constant that can be changed to change the number of terms printed 6 pts
Program uses static methods to remove redundancy 6 pts
Program aesthetics 6 pts
Total 30 pts