willieshi232

Untitled

Sep 20th, 2015
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. 1.public class Project1
  2. {
  3. public static void main(String [] args)
  4. {
  5. for(int row=0; row<=6; row++)
  6. {
  7. for(int star1=1; star1<=-1*row+6; star1++)
  8. {
  9. System.out.print("*");
  10. }
  11. for(int blank1=1; blank1<=row+1; blank1++)
  12. {
  13. System.out.print(" ");
  14. }
  15. for(int fslash=1; fslash<=-2*row+12; fslash++)
  16. {
  17. System.out.print("/");
  18. }
  19. for(int bslash=0; bslash<=row*2;bslash++)
  20. {
  21. System.out.print("\\");
  22. }
  23. for(int blank2=1;blank2<=row+1;blank2++)
  24. {
  25. System.out.print(" ");
  26. }
  27. for(int star2=1; star2<=-1*row+6;star2++)
  28. {
  29. System.out.print("*");
  30. }
  31. System.out.println("");
  32. }
  33. }
  34. }
  35. 4.public class project4
  36. {
  37. public static void main(String[] args)
  38. {
  39. line();
  40. System.out.println("");
  41. top1();
  42. top2();
  43. line();
  44. }
  45. public static void line()
  46. {
  47. System.out.print("|\"\"\"\"\"\"\"\"\"\"|");
  48. }
  49. public static void top1()
  50. {
  51. for(int row=1; row<=4; row++)
  52. {
  53. for(int blank1=1; blank1<=row; blank1++)
  54. {
  55. System.out.print("");
  56. }
  57. System.out.print("\\");
  58. for(int dots=1; dots<=-2*row+10;dots++)
  59. {
  60. System.out.print(":");
  61. }
  62. System.out.print("/");
  63. System.out.println("");
  64. }
  65. }
  66. public static void top2()
  67. {
  68. for(int row=1; row<=4; row++)
  69. {
  70. System.out.print("/");
  71. for(int dots=1; dots<=2*row; dots++)
  72. {
  73. System.out.print(":");
  74. }
  75. System.out.print("\\");
  76. System.out.println("");
  77. }
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment