Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. //Ricardo Jaramillo
  2. // Hourglass project
  3. // 12-18
  4. public class Hourglass
  5.  
  6. {
  7.  
  8. public static void main (String[] args)
  9. {
  10.  
  11.  
  12. line();
  13. firsthalf();
  14. middle();
  15. bottom();
  16. line();
  17. }
  18.  
  19.  
  20.  
  21. public static void line()
  22. {
  23. System.out.print("|");
  24. for (int i =1; i <=10; i++)
  25. {
  26. System.out.print("\"");
  27. }
  28. System.out.print("|");
  29.  
  30. System.out.println();
  31. }
  32.  
  33.  
  34. public static void firsthalf()
  35. {
  36. for (int line =1; line <=4; line++)
  37. {
  38. for (int space=1; space <= (line * 1 + 1 ); space++)
  39. {
  40. System.out.print(" ");
  41. }
  42.  
  43. for (int semicolon =1; semicolon <= (line * -2 + 10); semicolon++)
  44. {
  45.  
  46. System.out.print(":");
  47. }
  48.  
  49. for (int space=1; space <= (line * 1 + 1); space++)
  50. {
  51. System.out.print(" ");
  52.  
  53. }
  54.  
  55. System.out.println();
  56. }
  57. }
  58.  
  59.  
  60. public static void middle()
  61. {
  62. for (int line =1; line <=1; line = (line * 5))
  63. {
  64. System.out.print("");
  65. }
  66.  
  67. System.out.print(" ||");
  68.  
  69. for (int line =1; line <=1; line = (line * 5))
  70. {
  71. System.out.print(" ");
  72. }
  73. System.out.println();
  74. }
  75.  
  76.  
  77. public static void bottom()
  78. {
  79. for(int line =1; line <=4; line++)
  80. {
  81. for (int space=1; space <= (line * -1 + 6); space++)
  82. {
  83. System.out.print(" ");
  84. }
  85.  
  86. for (int semicolon =1; semicolon <= (line * 2); semicolon++)
  87. {
  88. System.out.print(":");
  89. }
  90.  
  91. for (int space=1; space <= (line * -1 + 6); space++)
  92. {
  93. System.out.print(" ");
  94. }
  95.  
  96. System.out.println();
  97. }
  98. }
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement