Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Java Program MY NAME

Have Programming Question? Ask it here!
 
 
 


saleem wardak
Java Program MY NAME
1 Answer(s)      2 years and 6 months ago
Posted in : Java Beginners


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.


Advertisement
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
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
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
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
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
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
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
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
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
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
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
Java example program to get the operating system name of the system
Java example program to get the operating system name of the system       java get Operating System name Many times we need to know the current operating system name on which we
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
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
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
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
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 StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code  hi, I have done a program whereby it can read a Java file and then tokenize them into tokens. However, I am facing
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
NAME SORTING. . .anyone? - Java Beginners
NAME SORTING. . .anyone?  how can I sort names without using the 'name.sort' method? please help. . .anyone? the program should sort the first three(3) letters of the names tnx java masters out there!! (^_^) cVm  Hi
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
CORE JAVA get middle name
CORE JAVA get middle name  hello sir...how to get middle name using string tokenizer....??? eg..like name ANKIT it will select only K...!!!!   The given code accepts the name from the console and find the middle
clarify my question - Java Beginners
clarify my question  Dear Sirs/Expert, Thanks for writing back... the matching tutors to the parent. I was telling you that my degree...:- parent id, contact, name,address,location, tutor id, name, contact, location
to add on to my queries - Java Beginners
to add on to my queries   Dear Experts, Sorry but I am worried that I did not explain clearly so I am adding in the error message I get from... word or an argument name that is misspelled or missing, or the punctuation
Help Me in My Java Work
Help Me in My Java Work  Can you help me please... Write a Java application, to be called GpaCalculator, which will return a grade point average (GPA) when given a range of decimal figures representing a selection of exam marks
this is my code java - Date Calendar
this is my code java  /* * NewJFrame.java * * Created on 11...; jTextField1.setText(months); #### This My problem jTextField2.setText(days); #### This My problem jTextField3.setText(years); #### This My problem how
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 Get Host Name
Java Get Host Name       In this Example you will learn how to get host name in Java. Go through... of a computer or an IP address using Java application language. The given program
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 thailand
java how to get domain name from url
java how to get domain name from url  How to get the domain name from a url string? Example program in java for "how to get domain name from url" Thanks   Hi, You can use the following example code: URL linkURL
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
Addition to my previous post - Java Beginners
Addition to my previous post  Addition to my previous question about the address book program. I need to have separate classes: CmdLineAddressBook.java AddressBook.java Contact.java Address.java Name.java
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  A Java Program that print the data on the printer but buttons not to be printed
ERROR with my JAVA code - Java Beginners
ERROR with my JAVA code  The error came up in my main method... it wasnt there until i finished my actionListener coding so I dont know how to fix...(); label1.setText("Name:"); p4.add(label1); text1 = new JTextField(20
java program
java program  write a java script program that would input the ff... and below no discount   write a java script program that would...% 84 and below no discount   write a java script program
Remote System OS name in JAVA - JSP-Servlet
Remote System OS name in JAVA  I need to print the different os names of the all computers in my local network. I know that with System.getProperty("os.name"), I get the os name of my computer but for the other computers, I have
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  Write a Java program to accept an array list...; class Employee{ int no; String name; String address; Employee(int no,String name,String address){ this.no=no; this.name=name
java program
java program  write a program to print 1234 567 89 10
Advertisements
 

 

 

DMCA.com