style.css" type="text/css" rel="stylesheet" />
Homework 2 (ASCII Art / Rocket Ship) FAQ
-
Q: How do I figure out what my loop should go up to? I don't understand nested loops!
-
A: The outer loop is the "vertical" loop and is fairly simple; it generally counts the lines from 1 to however many lines there are in that section of the figure. The inner loop is the "horizontal" one and requires more skill to get right. Use an inner loop for every portion of the line that is repeated, and use the slope-intercept formula and loop tables (as shown in class) to figure out how many repetitions to use.
-
Q: How do I add in the constant?
-
A: Try making a loop table at two different figure sizes and compare expressions from size 10 to size 16 (for example), to help factor out the constant. See section handout 2, Q6.
-
Q: Do I need to eliminate partial-line redundancy?
-
A: Not unless it's a very large and very redundant part of a line.
-
Q: Is this okay for my Part A drawing? Will it get full credit?
-
A: As long as it meets the guidelines in the assignment writeup, it should be fine.
-
Q: What resources can I use to help me get started?
-
A: Chapter 2's case study goes through the process of solving a very similar problem. Mirror.java from lecture also is very similar. See the section 2 handout for loop tables (#2), displaying figures (#4), and constants (#5 and #6).
-
Q: Why are there blank lines at random places in my output?
-
A: This is the result of a known jGRASP bug. Your code is most likely fine if the output works for another constant value.
-
Q: We learned about parameters in class. Do I need to use these in my DrawRocket.java program?
-
A: No. You only need to use the material up through the day the homework assignment was released. You are welcome to use parameters if you want, but it is not required for the assignment.