|
serrada_eskrimador
|
read my profile
sign my guestbook
Name: Albert Country: United States State: Washington Birthday: 8/28/1985 Gender: Male
Interests: ESCRIMA, video games, drawin, calc, xmods.......and Charmane Expertise: HALO 2....(when it comes out Nov. 9th, already reserved my copy, how bout u?), Soul Calibur II (for xobx), DDR, watchin my friend's backs, thinking, procrastinatin Industry: Other
Message: message me
Member Since:
3/18/2004
|
|
| //Albert Gamponia
//4/10/05
//CSE142
//TA: Bell
//Assignment#2
//
//This program is designed to utilize for loops class constants and
static methods in ch. 1 and 2 to create a rocket that can vary in size
when the class constant variable is changed
public class DrawRocket{
public static final int SUB_HEIGHT=7;
public static void main(String[] args) {
drawCone();
drawLine();
drawTop();
drawLine();
drawBottom();
drawLine();
drawCone();
}
public static void drawLine() {
System.out.print("+");
for(int col=1;col<=2*SUB_HEIGHT;col++) {
System.out.print("=*");
}
System.out.println("+");
}
public static void drawCone() {
for(int line=1;line<=2*SUB_HEIGHT-1;line++) {
for(int col=1;col<=((2*SUB_HEIGHT)-line);col++)
System.out.print(" ");
for(int col=1;col<line+1;col++)
System.out.print("/");
System.out.print("**");
for(int col=1;col<line+1;col++)
System.out.print("\\");
System.out.println(" ");
}
}
public static void drawTop() {
drawUpper();
drawLower();
}
public static void drawBottom() {
drawLower();
drawUpper();
}
public static void drawUpper() {
for(int line=1;line<=SUB_HEIGHT;line++) {
System.out.print("|");
for(int col=1;col<=SUB_HEIGHT-line;col++)
System.out.print(".");
for(int col=1;col<=line;col++)
System.out.print("/\\");
for(int col=1;col<=SUB_HEIGHT-line;col++)
System.out.print(".");
for(int col=1;col<=SUB_HEIGHT-line;col++)
System.out.print(".");
for(int col=1;col<=line;col++)
System.out.print("/\\");
for(int col=1;col<=SUB_HEIGHT-line;col++)
System.out.print(".");
System.out.println("|");
}
}
public static void drawLower() {
for(int line=1;line<=SUB_HEIGHT;line++) {
System.out.print("|");
for(int col=1;col<=line-1;col++)
System.out.print(".");
for(int col=1;col<=(SUB_HEIGHT+1)-line;col++)
System.out.print("\\/");
for(int col=1;col<=line-1;col++)
System.out.print(".");
for(int col=1;col<=line-1;col++)
System.out.print(".");
for(int col=1;col<=(SUB_HEIGHT+1)-line;col++)
System.out.print("\\/");
for(int col=1;col<=line-1;col++)
System.out.print(".");
System.out.println("|");
}
}
} | | |
| Akon - "Lonely"
......next year perhaps | | |
| yep...any day now...and ill retire form xanga fer good....aaaaannnyyyy day now...im not a procrastinator...i just dont get around to things as quickly w/ my busy life/schedule...... | | |
| OFFICIAL: im retiring xanga.....very very soon...i juss gotta do sumthings then im gone | | |
| asasfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf qwertqwerqwertyqwertyqwertyqertqwerty | | |
|