Ask your own question, for FREE!
Computer Science 4 Online
OpenStudy (anonymous):

I need help with the Second Initial of this Java Program. I will attach file.

OpenStudy (anonymous):

OpenStudy (anonymous):

I cannot get it to read the second initial. The way I have it now does capitalize both initials but the position keeps giving me the same one if I input for example linda ross it capitalizes L.L. instead of L.R.

OpenStudy (mathmate):

Well, you will have to read up about the scrn.next() command. It has a default delimiter of a space, " ". So it reads only the first name. You can check that by printing what you read (a good debugging tool). System.out.println(name); right after reading in the name will do. All you need to change is to use the method .nextLine() instead of .next() Later on, the code is good, except that there is a line of code that modified "name" unnecessarily. I'll let you check that.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
16 hours ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
19 hours ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Arizona: does anyone know the percentage rate of 30,000 and 40,000
1 week ago 0 Replies 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!