Hi,
The code below will get you started. I am not too sure if you had certain restrictions on the type of functions and methods you could use, but the example I have provided will get you through the disk and looking great.
CODE
// This program produces the Space Needle
public class Cool {
public static final int HEIGHT = 4;
public static void main(String[] args) {
printNeedle();
drawFigure();
}
// Produce the needle at the top
public static void printNeedle () {
for (int i = 1; i <= HEIGHT; i++) {
for (int j = 1; j <= 1; j++) {
System.out.printf("%14s\n", "||");
}
}
}
public static void drawFigure() {
// Temporary variable to hold the line during assembly
String line;
for (int i = 0; i < HEIGHT; i++) {
line = "__/";
// For lines 5-8 calculate number colons
for (int j = 0; j < i; j++) {
line = line + ":::";
}
// Add the pipe in the middle and pad it with spaces to line up
line = line + "||";
System.out.printf("%14s",line);
for (int j = 0; j < i; j++) {
System.out.print(":::");
}
System.out.print("\\__\n");
}
}
}
Take note of the use of printf which will give you the proper padding of spaces to your string so that you can get the pipes to line up. I threw this solution together really quick and it has been tested, but it is of course a bit of a ways from completion.
The tools you can learn from the segment I provided will help you establish the center of the need for the rest of the drawing and can make the rest pretty easy I believe.
It's rude and crude and can be seriously refactored, but it works.
Enjoy!