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









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
details of my program - Java Beginners
details of my program  hi 1- allow the customer to order any thing... array but it could make the program much longer note: i want to use the method... stupid alittle bit but this is my home work  import java.util.
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
doubt in my program code - Java Beginners
doubt in my program code  i have developed a web browser with the help of standard widget toolkit(swt) and java. i creted some buttons such as GO,REFRESH,STOP.... on which the name is not apppeared as GO,STOP...but the name
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
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
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
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 ... example which describes you that how you can get the class name without package. For this purpose we have to fetch first the full class name with package
Java example program to get the operating system name of the system
Java example program to get the operating system name of the system... of java code gets the OS name and assign it to a string variable. Now by printing...;java GetOSName Operating system name =>Windows 2000 Download
Java class name and file name are different
Java class name and file name are different  Can we run a Java program having class name and file name different?   Hi Friend, No, you can't. It is necessary to save the java file with its class name otherwise
Constructing a File Name path in Java
Constructing a File Name path        In Java, it is possible to set dynamic path, which is helpful for mapping local  file name with the actual path of the file using
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
java not run on my pc
java not run on my pc  i have installed java in pc but when i run and compile any program the massage is display that 'javac' is not recognized as an internal or external command
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
Name
Name  make a program that take a input from user in alphabet and show all the name of that character E.g User give character "B". The program shows all the human names which starts from B.   Java show all names
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
PLEASE HELP WITH MY JAVA
PLEASE HELP WITH MY JAVA  Hey my name is Gavin and im a student at school that takes IT. my teacher has gave me a problem and i can't figure it out please help!!!!!!!! it is a for-loop question: Display the first 5 multiples
Help With My Java Project?
Help With My Java Project?  Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign it to a two-dimension array where
I want to change my user name on your website ,how can i do this
I want to change my user name on your website ,how can i do this  I want to change my user name on your website ,how can i do this   You can create another account very easily with different username
java program for
java program for   java program for printing documents,images and cards
java program
java program  Write a Java application to print your name, ID, gender, and nationality.. the output will look like this : my id is 0123456789 i am a man i am from thailandADS_TO_REPLACE_1
Java Program
Java Program  A Java Program that print the data on the printer but buttons not to be printed
java program
java program  write a program to print 1234 567 89 10
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 java script program that would input the ff:Student Name,Average,Tuition Fee and output Total Tuition Fee. Formula: Total... 10% 84 and below no discount Sample Output: Student Name:_ Average:_ Tuition Fee
java program
java program  Write a program to demonstrate the concept of various possible exceptions arising in a Java Program and the ways to handle them.  ... in Java
java program
java program  how to write an addition program in java without using arithematic operator
java program
java program  Write a java program to do matrix addition operation On two given matrices
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
java program
java program  write a java program to display array list and calculate the average of given array
Java Program
Java Program  java program to insert row in excel sheet after identifying an object
java program
java program  java program to implement the reflection of a particular class details like constructor,methods and fields with its modifiers
java program
java program  Write a java program to find the number of Positive numbers in m* n matrix
java program
java program  Write a program to create an applet and display The message "welcome to java
java program
java program  hi friends how to make a java program for getting non prime odd numbers in a given series

Ads