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
Printable View
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
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
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
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.