Home Answers Viewqa Java-Beginners Java Program MY NAME

 
 


saleem wardak
Java Program MY NAME
1 Answer(s)      a year and 3 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.

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 Pages:
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
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
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
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
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
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 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
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
Get Property by Name
: C:\Program Files\Java\jdk1.6.0_01\jre\bin... : C:\Program Files\Java\jdk1.6.0_01\jre\lib\endorsed...\Java\bin;C:\WINNT\system32; C:\WINNT;.;C:\Program
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 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 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
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
Combine Name
Java: Example - CombineName The following program has two text fields, one for a first name and one for a last name. When the button is pressed...! Enhance the program to handle a middle name. Produce a combined 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
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
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
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
Programming - Transform Name
Java: Programming - Transform Name Write a program to redisplay a name, possibly transformed This Java program will reformat a user's name. There are two cases that have to be handled: the trivial case of a single name, where
Programming - Transform Name - Answer
Java: Programming - Transform Name - Answer Solution to: Write a program to redisplay a name, possibly transformed. This Java program will reformat a user's name from "First Last" to "Last, First". There are two cases
my sql innodb
my sql innodb  Write a java program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL
Java Program - Java Beginners
Java Program  My friend has a java project. He wanted to have java program that has 4 menu options which are (1)Add Data(from the user:last name, first name and age),(2)Sort Data,(3)Insert Data and (4)Delete Data, but he didn't
name of year in chinese
name of year in chinese   hello my name kiemtheng i'm come from Cambodia, i would to write java programming to calculate a name of year for each birthday in Chinese but i dont know how to do.   import java.util.
Programming - Transform Name - GUI 0
Java: Programming - Transform Name - GUI 0 Write a GUI program to redisplay a name, possibly transformed. This Java program will reformat a user's name... be good extra credit for this program. You can easily use the Java functions
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
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 of year in chinese
name of year in chinese   hello my name kiemtheng i'm come from Cambodia, i would to write java programming to calculate a name of year for each birthday in Chinese but i dont know how to do.   import java.util.
My sql - JDBC
My sql  hi, I have a table in MySql, having fields, emp_id,emp_name,emp_vertical,emp_supervisor. i need a JDBC program with driver mangager for MySQL, statements, preparedstatements,resultset. Please can you suggest me a way
plz solve my query?
plz solve my query?  how to remove all the options from select control in html using java script?   JavaScript remove all items <...); } } </script> <form name="list"> <select id="item" NAME="item"> <
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
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
help in java program
help in java program  please could you help me with my assignment I have to submit it on Monday 29 October please help me :( Write a program to test the Person class defined below. Your test program should
Import My Own Package (Automatically)
Import My Own Package (Automatically)   How can I import my own package in every java program ( automatically )....? For example :- java.lang.String... automatically imported, we need not to import
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
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 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
Program - Java Beginners
Name: Raga Emp ID:234 Dept ID:432 Name:Raja Emp ID:234 Dept ID:435 Do you...\bin>_ But As per my code,The No OF Records is 2.. But as per my requirement... must be: Name: Raga Emp ID:234 Dept ID:432 Name:Raja Emp ID:234 Dept ID
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 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
Find Name of Excel Sheet
Find Name of Excel Sheet       In this program we are going to find the name of an excel... This is basically stores the sheet name and tells where the beginning of file record
Duplicate name in Manifest - JSP-Servlet
just put the current JDK that I'm using now. C:\Program Files\Java\jdk1.6.0_12...Duplicate name in Manifest   Hello, I don't have the classpath... WARNING: Duplicate name in Manifest: Depends-On. Ensure that the manifest does
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
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
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
connect database without specifying dsn name in java
connect database without specifying dsn name in java  How can i connect the database with my application without specifying the dsn name by using jdbc & odbc..... i have saw this code on the web-site try

Ask Questions?

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.