Created
September 8, 2018 14:43
-
-
Save Animeshz/84b0023b6f8c45044c75ba58f41ed964 to your computer and use it in GitHub Desktop.
TeluskoLearning Assignment of chapter 3.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TeluskoLerning3_4Assignment | |
{ | |
public void assignment1() | |
{ | |
for(int i=1; i<=6; i++) { | |
for (int j=1; j<=i; j++) { | |
System.out.print(j + " "); | |
} | |
System.out.println(); | |
} | |
} | |
public void assignment2() | |
{ | |
for(int i=1; i<=3; i++) { | |
for (char j='A'; j-64<=i; j++) { | |
System.out.print(j + " "); | |
} | |
System.out.println(); | |
} | |
} | |
public void assignment3() | |
{ | |
int length = 6; | |
for (int i = 1; i <= length; i++) { | |
for (int j = 1; j <= length; j++) { | |
if (!((i==length || i==1) || (j==length || j==1))) { | |
System.out.print(" "); | |
continue; | |
} | |
System.out.print("$ "); | |
} | |
System.out.println(); | |
} | |
} | |
public static void main(String[] args) | |
{ | |
TeluskoLerning3_4Assignment t = new TeluskoLerning3_4Assignment(); | |
t.assignment1(); | |
System.out.println(); | |
t.assignment2(); | |
System.out.println(); | |
t.assignment3(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment