Advertisement
willieshi232

Untitled

Sep 17th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. 14-22 Even
  2. 14.public class Numbers
  3. {
  4. public static final int x=10;
  5. public static void main (String[] args)
  6. {
  7. for(int row=1; row<=4; row++)
  8. {
  9. for(int nine=1; nine<=x-1;nine++)
  10. {
  11. System.out.print("9");
  12. }
  13. for (int eight=1; eight<=x-2;eight++)
  14. {
  15. System.out.print("8");
  16. }
  17. for (int seven=1; seven<=x-3;seven++)
  18. {
  19. System.out.print("7");
  20. }
  21. for (int six=1; six<=x-4;six++)
  22. {
  23. System.out.print("6");
  24. }
  25. for (int five=1; five<=x-5;five++)
  26. {
  27. System.out.print("5");
  28. }
  29. for (int four=1; four<=x-6;four++)
  30. {
  31. System.out.print("4");
  32. }
  33. for (int three=1; three<=x-7; three++)
  34. {
  35. System.out.print("3");
  36. }
  37. for (int two=1; two<=x-8; two++)
  38. {
  39. System.out.print("2");
  40. }
  41. System.out.println("1");
  42. }
  43. }
  44. }
  45. 16.public class SlashFigures
  46. {
  47. public static void main(String [] args)
  48. {
  49. for(int row=1; row<=6; row++)
  50. {
  51. for(int bslash=1; bslash<=2*row; bslash++)
  52. {
  53. System.out.print("\\");
  54. }
  55. for(int Ex=1; Ex<=-4*row+26; Ex++)
  56. {
  57. System.out.print("!");
  58. }
  59. for(int fslash=1; fslash<=2*row; fslash++)
  60. {
  61. System.out.print("/");
  62. }
  63. System.out.println("");
  64. }
  65. }
  66. }
  67. 18.
  68. Draw a solid line
  69. Draw a Window
  70. Draw a solid line
  71. Draw a Window
  72. Draw a solid line
  73. solid line-
  74. write a plus sign on the output line
  75. write 3 equal signs on the output line
  76. write a plus sign on the output line
  77. write 3 equal signs on the output line
  78. write a plus sign on the output line( go to new line of output)
  79. Window-
  80. write a bar
  81. write 3 spaces
  82. write a bar
  83. write 3 spaces
  84. write a bar( go to new line of output)
  85.  
  86. 20.public class StarFigure
  87. {
  88. public static void main(String[] args)
  89. {
  90. for(int row=1; row<= 5; row++)
  91. {
  92. for(int fslash=1; fslash<=-4*row+20; fslash++)
  93. {
  94. System.out.print("/");
  95. }
  96. for(int stars=1; stars<=8*row-8;stars++)
  97. {
  98. System.out.print("*");
  99. }
  100. for(int bslash=1; bslash<=-4*row+20; bslash++)
  101. {
  102. System.out.print("\\");
  103. }
  104. System.out.println("");
  105. }
  106. }
  107. }
  108. 22.
  109. public class DollarFigure
  110. {
  111. public static void main(String[] args)
  112. {
  113. for(int row=1; row<=7; row++)
  114. {
  115. for(int Star1=1; Star1<=2*row-2; Star1++)
  116. {
  117. System.out.print("*");
  118. }
  119. for(int Dollar1=1; Dollar1<=-1*row+8; Dollar1++)
  120. {
  121. System.out.print("$");
  122. }
  123. for(int Star2=1; Star2<=-2*row+16; Star2++)
  124. {
  125. System.out.print("*");
  126. }
  127. for(int Dollar2=1; Dollar2<=-1*row+8; Dollar2++)
  128. {
  129. System.out.print("$");
  130. }
  131. for(int Star3=1; Star3<=2*row-2; Star3++)
  132. {
  133. System.out.print("*");
  134. }
  135. System.out.println();
  136. }
  137. }
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement