daniel_lawson9999

Daniel Lawson Projects 1,2,3 - 5,6,7

Mar 16th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.30 KB | None | 0 0
  1. // Projects 1,2,3 and Projects, 5,6,7
  2. //Daniel Lawson
  3. //-------------------------------------------------------------------------------------------------------------------------------------
  4. /**
  5. * Created by Daniel on 3/14/2016.
  6. */
  7. public class Project1 {
  8.  
  9. public static void main (String[] args){
  10. for (int lines = 1; lines <=7;lines++){
  11.  
  12. for (int star = 1; star<= lines *-1 +7; star++){
  13. System.out.print("*");
  14. }
  15. for (int spaces =1; spaces <= lines*1; spaces++){
  16. System.out.print(" ");
  17. }
  18. for (int slash =1;slash <= lines*-2 +14;slash++){
  19. System.out.print("/");
  20. }
  21. for (int backSlash =1; backSlash <= lines*2 -2; backSlash++){
  22. System.out.print("\\");
  23. }
  24. for (int spaces =1; spaces <= lines*1; spaces++){
  25. System.out.print(" ");
  26. }
  27. for (int star = 1; star<= lines *-1 +7; star++){
  28. System.out.print("*");
  29. }
  30. System.out.println();
  31. }
  32. }
  33.  
  34. }
  35. //-------------------------------------------------------------------------------------------------------------------------------------
  36. /**
  37. * Created by Daniel on 3/14/2016.
  38. */
  39. public class Project2 {
  40. public static void main (String[] args){
  41. line();
  42. top();
  43. top();
  44. line();
  45. bottom();
  46. bottom();
  47. line();
  48.  
  49.  
  50. }
  51. public static void line (){
  52. System.out.println("+------+");
  53. }
  54. public static void top(){
  55.  
  56. for (int lines =1; lines <= 3;lines++){
  57. System.out.print("|");
  58. for(int spaces =1; spaces <= lines*-1 +3;spaces++){
  59. System.out.print(" ");
  60. }
  61. System.out.print("^");
  62. for(int middleSpaces =1; middleSpaces<=lines*2-2;middleSpaces++){
  63. System.out.print(" ");
  64. }
  65. System.out.print("^");
  66. for(int spaces =1; spaces <= lines*-1 +3;spaces++){
  67. System.out.print(" ");
  68. }
  69. System.out.print("|");
  70. System.out.println();
  71. }
  72.  
  73. }
  74. public static void bottom(){
  75. for (int lines =1; lines <= 3;lines++){
  76. System.out.print("|");
  77. for(int spaces =1; spaces <= lines*1 -1;spaces++){
  78. System.out.print(" ");
  79. }
  80. System.out.print("v");
  81. for(int middleSpaces =1; middleSpaces<=lines*-2 + 6;middleSpaces++){
  82. System.out.print(" ");
  83. }
  84. System.out.print("v");
  85. for(int spaces =1; spaces <= lines*1 -1;spaces++){
  86. System.out.print(" ");
  87. }
  88. System.out.print("|");
  89. System.out.println();
  90. }
  91. }
  92. }
  93. //-------------------------------------------------------------------------------------------------------------------------------------
  94. /**
  95. * Created by Daniel on 3/14/2016.
  96. */
  97. public class Project3 {
  98. public static void main (String[] args){
  99. line();
  100. top();
  101. bot();
  102. line();
  103. bot();
  104. top();
  105. line();
  106.  
  107. }
  108.  
  109. public static void line(){
  110. System.out.println("+---------+");
  111.  
  112. }
  113. public static void top(){
  114. for(int line =1;line<= 4;line++){
  115. System.out.print("|");
  116. for(int space =1; space<=line*-1+5;space++){
  117. System.out.print(" ");
  118. }
  119. for(int slash =1; slash<= line*1-1;slash++){
  120. System.out.print("/");
  121. }
  122. System.out.print("*");
  123. for(int slash =1; slash<= line*1-1;slash++){
  124. System.out.print("\\");
  125. }
  126. for(int space =1; space<=line*-1+5;space++){
  127. System.out.print(" ");
  128. }
  129. System.out.println("|");
  130.  
  131. }
  132. }
  133. public static void bot(){
  134. for(int line =1;line<= 4;line++){
  135. System.out.print("|");
  136. for(int space =1; space<=line*1;space++){
  137. System.out.print(" ");
  138. }
  139. for(int slash =1; slash<= line*-1+4;slash++){
  140. System.out.print("\\");
  141. }
  142. System.out.print("*");
  143. for(int slash =1; slash<= line*-1+4;slash++){
  144. System.out.print("/");
  145. }
  146. for(int space =1; space<= line*1;space++){
  147. System.out.print(" ");
  148. }
  149. System.out.println("|");
  150.  
  151. }
  152. }
  153. }
  154. //-------------------------------------------------------------------------------------------------------------------------------------
  155. /**
  156. * Created by Daniel on 3/16/2016.
  157. */
  158. public class Project5 {
  159. public static final int GUYS = 9;
  160. public static void main (String[] args){
  161.  
  162. for(int stairs = 1; stairs <= GUYS; stairs++){
  163. //32 total
  164. // 21 spaces first time
  165. // 5
  166. for (int spaces = 1; spaces <= stairs*-5 + GUYS*5 +1; spaces++){
  167. System.out.print(" ");
  168. }
  169. System.out.print(" o ******");
  170. for (int lastSpaces =1; lastSpaces <= stairs*5 -5;lastSpaces++ ){
  171. System.out.print(" ");
  172. }
  173. System.out.println("*");
  174.  
  175.  
  176.  
  177. for (int spaces = 1; spaces <= stairs*-5 + GUYS*5 +1; spaces++){
  178. System.out.print(" ");
  179. }
  180. System.out.print("/|\\ *");
  181. for (int lastSpaces =1; lastSpaces <= stairs*5;lastSpaces++ ){
  182. System.out.print(" ");
  183. }
  184. System.out.println("*");
  185.  
  186.  
  187. for (int spaces = 1; spaces <= stairs*-5 + GUYS*5 +1; spaces++){
  188. System.out.print(" ");
  189. }
  190. System.out.print("/ \\ *");
  191. for (int lastSpaces =1; lastSpaces <= stairs*5;lastSpaces++ ){
  192. System.out.print(" ");
  193. }
  194. System.out.println("*");
  195.  
  196.  
  197.  
  198. }
  199. for(int floor =1; floor<= GUYS * 5 + 7; floor++) {
  200. System.out.print("*");
  201. }
  202. }
  203.  
  204.  
  205. }
  206. //-------------------------------------------------------------------------------------------------------------------------------------
  207. /**
  208. * Created by Daniel on 3/16/2016.
  209. */
  210. public class Project6 {
  211. public static final int SIZE =3;
  212. public static void main(String[] args) {
  213. point();
  214. line();
  215. upPyramid();
  216. downPyramid();
  217. line();
  218. downPyramid();
  219. upPyramid();
  220. line();
  221. point();
  222. }
  223.  
  224. public static void point() {
  225. for (int line = 1; line <= SIZE +2; line++) {
  226. for (int spaces = 1; spaces <= line * -1 + SIZE*2; spaces++) {
  227. System.out.print(" ");
  228. }
  229. for (int dash = 1; dash <= line * 1; dash++) {
  230. System.out.print("/");
  231. }
  232. System.out.print("**");
  233. for (int dash = 1; dash <= line * 1; dash++) {
  234. System.out.print("\\");
  235. }
  236. System.out.println();
  237. }
  238. }
  239.  
  240. public static void upPyramid(){
  241. for (int line =1; line <= SIZE; line++){
  242. System.out.print("|");
  243. for(int dot =1; dot<= line*-1 +SIZE ; dot++) {
  244. System.out.print(".");
  245. }
  246. for(int triangle =1; triangle <= line*1; triangle++){
  247. System.out.print("/\\");
  248. }
  249. for(int insideDot =1; insideDot<= line*-2+SIZE*2;insideDot++){
  250. System.out.print(".");
  251. }
  252. for(int triangle =1; triangle <= line*1; triangle++){
  253. System.out.print("/\\");
  254. }
  255. for(int dot =1; dot<= line*-1 +SIZE ; dot++) {
  256. System.out.print(".");
  257. }
  258. System.out.println("|");
  259. }
  260. }
  261. public static void downPyramid(){
  262. for (int line =1; line <= SIZE; line++){
  263. System.out.print("|");
  264. for(int dot =1; dot<= line*1 -1; dot++) {
  265. System.out.print(".");
  266. }
  267. for(int triangle =1; triangle <= line*-1+ SIZE+1; triangle++){
  268. System.out.print("\\/");
  269. }
  270. for(int insideDot =1; insideDot<= line*2-2;insideDot++){
  271. System.out.print(".");
  272. }
  273. for(int triangle =1; triangle <= line*-1+SIZE+1; triangle++){
  274. System.out.print("\\/");
  275. }
  276. for(int dot =1; dot<= line*1 -1; dot++) {
  277. System.out.print(".");
  278. }
  279. System.out.println("|");
  280. }
  281. }
  282.  
  283.  
  284. public static void line() {
  285. //System.out.println("+=*=*=*=*=*=*+");
  286. System.out.print("+");
  287. for(int characters =1; characters <= SIZE*2;characters++) {
  288. System.out.print("=*");
  289. }
  290. System.out.println("+");
  291. }
  292.  
  293.  
  294. }
  295. //-------------------------------------------------------------------------------------------------------------------------------------
  296. /**
  297. * Created by Daniel on 3/16/2016.
  298. */
  299. public class Project7 {
  300. public static final int SIZE = 100;
  301. public static void main (String args[]){
  302. normalNeedle();
  303. pyramid();
  304. line();
  305. downwardPyramid();
  306. normalNeedle();
  307. percentNeedle();
  308. percentNeedle();
  309. percentNeedle();
  310. percentNeedle();
  311. pyramid();
  312. line();
  313. }
  314. public static void normalNeedle(){
  315. for(int dash =1; dash <= SIZE; dash++){
  316. //12
  317. for(int space =1; space<=SIZE*3 ;space++){
  318. System.out.print(" ");
  319. }
  320. System.out.println("||");
  321. }
  322. }
  323. public static void pyramid() {
  324. for (int line = 1; line <= SIZE; line++) {
  325. for (int space = 1; space <= line * -3 + SIZE * 3; space++) {
  326. System.out.print(" ");
  327. }
  328. System.out.print("__/");
  329. for (int colon = 1; colon <= line * 3 - 3; colon++) {
  330. System.out.print(":");
  331. }
  332. System.out.print("||");
  333. for (int colon = 1; colon <= line * 3 - 3; colon++) {
  334. System.out.print(":");
  335. }
  336. System.out.println("\\__");
  337. }
  338. }
  339. public static void line(){
  340. System.out.print("|");
  341. for(int quote =1; quote<=SIZE *6;quote++){
  342. System.out.print("\"");
  343. }
  344. System.out.println("|");
  345. }
  346.  
  347.  
  348. public static void downwardPyramid(){
  349. for(int line =1; line<= SIZE; line++){
  350. for(int space =1; space<= line*2 -2;space++) {
  351. System.out.print(" ");
  352. }//11
  353. System.out.print("\\_");
  354. for(int dash =1; dash <= line*-2 + SIZE*3 +1;dash++){
  355. System.out.print("/\\");
  356.  
  357. }
  358. System.out.println("_/");
  359.  
  360. }
  361. }
  362.  
  363. public static void percentNeedle(){
  364. for(int dash =1; dash <= SIZE; dash++){
  365. //12- 3, 11
  366. for(int space =1; space<=SIZE*3 -3 ;space++){
  367. System.out.print(" ");
  368. }
  369. System.out.println("|%%||%%|");
  370. }
  371. }
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378. }
Advertisement
Add Comment
Please, Sign In to add comment