Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: How do you write a Java program that displays your initials?

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    3
    My Mood
    Inspired
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do you write a Java program that displays your initials?

    How do you write a Java program that displays your initials in capital letters using the corresponding letter. For example, if your name is “John Doe”

    JJJJJJJJJJJJ DDDDDDDDD
    JJJJJJJJJJJJ


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,166
    My Mood
    Hungover
    Thanks
    141
    Thanked 597 Times in 512 Posts

    Default Re: How do you write a Java program that displays your initials?

    System.out.println("JJJJJJJJJJJJ DDDDDDDDD");

    Seriously though, which part of this are you having trouble with? Take a look at the String API for some useful functions.

    Java Platform SE 6
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    3
    My Mood
    Inspired
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How do you write a Java program that displays your initials?

    The letters need to form my initials in large capital letters. I'm having problems with the just forming the initial code to make the program form my initials like

    cc c c c c c c c c
    c
    c
    c
    c
    c c c c cc c c c c

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,166
    My Mood
    Hungover
    Thanks
    141
    Thanked 597 Times in 512 Posts

    Default Re: How do you write a Java program that displays your initials?

    Well, how would you do this by hand, with a piece of paper and a pencil? How do you know where to draw the letters in the first place? Pretend you have a really dumb friend who has no idea how to do this. Write instructions out for him (remember how dumb he is, so keep your instructions short and simple) that he could follow to accomplish the task. When you have that finished, you'll have an algorithm that should be pretty easy to translate into code.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. How would I write this program?
    By mjballa in forum Java Theory & Questions
    Replies: 2
    Last Post: November 14th, 2011, 10:49 PM
  2. help me write java program
    By stevisto in forum Member Introductions
    Replies: 1
    Last Post: September 13th, 2011, 03:44 PM
  3. use multiple gui displays
    By jonwymore in forum AWT / Java Swing
    Replies: 1
    Last Post: November 19th, 2010, 09:11 AM
  4. how can i write this program
    By lavudyagopi27 in forum Java Theory & Questions
    Replies: 2
    Last Post: September 17th, 2010, 08:11 AM
  5. Someone please help me write a simple program!!!
    By ocean123 in forum Loops & Control Statements
    Replies: 3
    Last Post: June 14th, 2009, 09:46 PM