Java Program MY NAME

Java Program MY NAME

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.

View Answers

February 10, 2012 at 12:25 PM

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();
    }
}

Ads









Related Tutorials/Questions & Answers:
Java Program MY NAME
Java Program MY NAME   Write a class that displays your first name... with the following name (for example, for letter A, public displayLetterA... in the correct order to display your name
My name, java project
My name, java project  Write a class that displays your first name... that letter in a method with the following name (for example, for letter A, public displayLetterA() { code goes in here }, ...and my names hayley ... anyone
Advertisements
My name, java project
My name, java project  Write a class that displays your first name... that letter in a method with the following name (for example, for letter A, public displayLetterA() { code goes in here }, ...and my names hayley ... anyone
My first Java Program
My first Java Program  I have been caught with a practical exam to do the following: Write a program that takes input from a user through the command line. The user must be prompt to enter a sentence (anything). The sentence
java program for me to see who are on my server
java program for me to see who are on my server  Hello, Im a beginner in java, doing some tutorials and stuff. I wanna write a java program to put... them so save their name and info on my server
I need add my java program with a picture.
I need add my java program with a picture.  Good evng Frnds Friends i created 1 jar file in my desktop. I need add this program with 1 picture. Whenever the user double clicking on that picture The program must start instead
Java program to get domain name by URL
Java program to get domain name by URL       We can also get the domain name by the java program. Domain name are used to represent the symbolic representation
ModuleNotFoundError: No module named 'whats_my_name'
ModuleNotFoundError: No module named 'whats_my_name'  Hi, My... 'whats_my_name' How to remove the ModuleNotFoundError: No module named 'whats_my_name' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'whats-my-name-jx'
ModuleNotFoundError: No module named 'whats-my-name-jx'  Hi, My... named 'whats-my-name-jx' How to remove the ModuleNotFoundError: No module named 'whats-my-name-jx' error? Thanks   Hi, In your
My first struts 2 program
My first struts 2 program  Hi, Please help me for my first struts 2... from one page to another. Details: I am trying my first Struts 2 example program. I want to pass values from first loginpage.jsp to displaypage.jsp. I
How to register domain name for my Company?
How to register domain name for my Company?  Hi, Where and How to register domain name for my Company? Thanks   Many website... the domains from those websites. Check the tutorial How to register domain name
Java program to create a frame with 4 fields;name,sreet,city,pin;with suitable table
Java program to create a frame with 4 fields;name,sreet,city,pin;with suitable table  Java program to create a frame with 4 fields;name,street,city,pin;with suitable table. Also add a button "OK". whe it is clicked
write a java program to print marklist of n students. input Register number, name and marks of three subjects.
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.  write a java program to print marklist of "n " students. input Register number, name and marks of three subjects
To write a Java program To create a frame with 4 fields;name,street,city,pin;with suitable table
To write a Java program To create a frame with 4 fields;name,street,city,pin;with suitable table  I want to write a Java program To create a frame with 4 fields;name,street,city,pin;with suitable table
Get computer name in java
Get computer name in java       We can get the computer name by the java code program. For getting computer name we have used java.net.InetAddress class. We will use static
ModuleNotFoundError: No module named 'my_print_haha_program'
ModuleNotFoundError: No module named 'my_print_haha_program'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'my_print_haha_program' How to remove the ModuleNotFoundError
Why is my program running an infinite loop? Parallel Arrays Program
Why is my program running an infinite loop? Parallel Arrays Program  ... ("0.##"); double[]gpa=new double [5]; String[]name=new String [5... a name: "); name[i]=input.nextLine(); System.out.println("Enter
Java program to get class name without package
Java program to get class name without package ...:\javaexamples>java GetClassWithoutPackage Full class name =java.lang.String... example which describes you that how you can get the class name without package
Constructing a File Name path in Java
; } Output of the program: C:\java>java ConstructingFileNamePath... Constructing a File Name path        In Java, it is possible to set dynamic path, which
a Java program
a Java program    Write a Java program to print even numbers from 2 to 1024? Write a Java program to print ? My Name is Mirza? 100 times? Write a Java program to print Fibonacci Series? Write a Java program to reverse a number
i have problem in that program to my assignment sir - JavaMail
i have problem in that program to my assignment sir   Develop a programmer's editor in Java that supports syntax-highlighting, compilation support, debugging support, etc
how to use yield(),join() methods in program.where it is usefull in my program
how to use yield(),join() methods in program.where it is usefull in my program  Hi i am using yield() in my program but the out put i can't... thread with same priority .but in my example i can't findout exact function
how to use yield(),join() methods in program.where it is usefull in my program
how to use yield(),join() methods in program.where it is usefull in my program  Hi i am using yield() in my program but the out put i can't... thread with same priority .but in my example i can't findout exact function
java program for
java program for   java program for printing documents,images and cards
java program
java program  Please help me to write a Java program that ask a user to enter his/her name ,surname and then ask how many Item he / she want to buy using loop according number of item also ask name of item and price(double
java program
java program  Please help me to write a Java program that ask a user to enter his/her name ,surname and then ask how many Item he/she want to buy using loop according number of item also ask name of item and price(double
java program
java program  write a program to print 1234 567 89 10
Java program
Java program  Write a Java program that tales filename or directo;ry name from command line. If it is a vlid flename then it should display its size.If it is a valid directory name then it shouls disply the count of numer
java program
java program  how to write an addition program in java without using arithematic operator
java program
java program  write java program for constructor,overriding,overriding,exception handling
java program
java program  write a java program to display array list and calculate the average of given array

Ads