Focus mode
Çok boyutlu diziler kullanılarak "yıldızlar" ile ekrana "B" harfi yazan programı yazınız.
* * * *
* *
* *
* * * *
* *
* *
* * * *
public class Main {
public static void main(String[] args) {
String[][] letter = new String[6][4];
for (int i = 0; i < letter.length; i++) {
for (int j = 0; j < letter[i].length; j++) {
if (i == 0 || i == 2) {
letter[i][j] = " * ";
} else if (j == 0 || j == 3) {
letter[i][j] = " * ";
} else {
letter[i][j] = " ";
}
}
}
for (String[] row : letter){
for (String col : row){
System.out.print(col);
}
System.out.println();
}
}
}
For a quick start in software development from scratch, check out our specialized training courses
Do you need more education, projects, and mentor support in your journey to learn programming? Join Patika+'s intensive 4-8 month bootcamps, gain all the necessary skills with project-based live classes and customized trainings for you, and start your career!
You need to enroll in the course to be able to comment!