
Write a class that displays your first name vertically down the screen where each letter uses up to 5 rows by 5 columns of a character input by you with a blank line between each letter. Note: each letter should have the lines of code needed to display that letter in a method with the following name (for example, for letter A, public displayLetterA() { }, Then, method main should create an object of your class, then call the methods in the correct order to display your name.

class DisplayNameInPattern
{
public void displayR(){
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
System.out.print("R");
}
System.out.println();
}
}
public void displayO(){
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
System.out.print("O");
}
System.out.println();
}
}
public void displayS(){
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
System.out.print("S");
}
System.out.println();
}
}
public void displayE(){
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
System.out.print("E");
}
System.out.println();
}
}
public static void main(String[] args)
{
DisplayNameInPattern p=new DisplayNameInPattern();
p.displayR();
System.out.println();
p.displayO();
System.out.println();
p.displayS();
System.out.println();
p.displayE();
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.