Advertisement
wuvic21

Untitled

Oct 1st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. /*
  2. Victor Wu
  3. Period 1
  4. 10/1/19
  5. Chapter 2 Project
  6. */
  7. package forloops;
  8.  
  9.  
  10. public class ForLoops {
  11.  
  12.  
  13. public static void main(String[] args) {
  14. problem1();
  15. problem2();
  16. problem3();
  17. }
  18. public static void problem1(){
  19. for(int i= 1 ; i <= 5; i++) {
  20. for(int j = 1; j <= i; j++){
  21. System.out.print(i);
  22. }
  23. System.out.println();
  24. }
  25. System.out.println();
  26.  
  27. }
  28. public static void problem2() {
  29. for(int i = 1; i <= 5; i++){
  30. for(int j = 1; j <= 5-i; j++){
  31. System.out.print(" ");
  32. }
  33.  
  34. for(int j = 1; j <= i; j++){
  35. System.out.print(i);
  36. }
  37. System.out.println();
  38. }
  39. System.out.println();
  40. }
  41. public static void problem3() {
  42. for(int i = 1; )
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement