Advertisement
zainarfi00

Chapter 2 Test Question 2

Sep 25th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. /**
  2. * Chapter 2 Question 2
  3. *
  4. * Zain Arfi
  5. * @version (a version number or a date)
  6. */
  7. public class TestQ2
  8. {
  9. public static final int size=10;
  10. public static void main(String[] args)
  11. {
  12. for(int row=1; row<=5; row++)
  13. {
  14. for(int dashes=1; dashes<=row*-1+size+1; dashes++)
  15. {
  16. System.out.print("-");
  17. }
  18. for(int numb=1; numb<=row*2-1; numb++)
  19. {
  20. System.out.print(2*row-1);
  21. }
  22. for(int dashes=1; dashes<=row*-1+size+1; dashes++)
  23. {
  24. System.out.print("-");
  25. }
  26. System.out.println();
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement