Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Ricardo Jaramillo
- // Hourglass project
- // 12-18
- public class Hourglass
- {
- public static void main (String[] args)
- {
- line();
- firsthalf();
- middle();
- bottom();
- line();
- }
- public static void line()
- {
- System.out.print("|");
- for (int i =1; i <=10; i++)
- {
- System.out.print("\"");
- }
- System.out.print("|");
- System.out.println();
- }
- public static void firsthalf()
- {
- for (int line =1; line <=4; line++)
- {
- for (int space=1; space <= (line * 1 + 1 ); space++)
- {
- System.out.print(" ");
- }
- for (int semicolon =1; semicolon <= (line * -2 + 10); semicolon++)
- {
- System.out.print(":");
- }
- for (int space=1; space <= (line * 1 + 1); space++)
- {
- System.out.print(" ");
- }
- System.out.println();
- }
- }
- public static void middle()
- {
- for (int line =1; line <=1; line = (line * 5))
- {
- System.out.print("");
- }
- System.out.print(" ||");
- for (int line =1; line <=1; line = (line * 5))
- {
- System.out.print(" ");
- }
- System.out.println();
- }
- public static void bottom()
- {
- for(int line =1; line <=4; line++)
- {
- for (int space=1; space <= (line * -1 + 6); space++)
- {
- System.out.print(" ");
- }
- for (int semicolon =1; semicolon <= (line * 2); semicolon++)
- {
- System.out.print(":");
- }
- for (int space=1; space <= (line * -1 + 6); space++)
- {
- System.out.print(" ");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement