CHALLANGE: Capitalize and display names (string). | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 6

CHALLANGE: Capitalize and display names (string).

Write a program that receive string input (Names) and the displays each name in a new. The separator is comma followed by space Example, the list (john, fatima, bill, christy. the ouptu should look like this: 1. Name: John 2. Name: Fatima 3. Name: Bill 4. Name: Christy

16th Jan 2018, 2:51 PM
StoneCoderšŸ‡¬šŸ‡¦
StoneCoderšŸ‡¬šŸ‡¦ - avatar
7 Respostas
18th Jan 2018, 9:34 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 13
@John Dooe Really !! as The Best !! šŸ˜† Thanks a lot mate !! šŸ‘ && I'm really honored !! šŸ¤—
21st Jan 2018, 11:55 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 4
@mustacacqn can your code doesn't seem to capitalize the first later of every string, plus will be good if you provide the code in the playground so we try...
17th Jan 2018, 11:34 AM
StoneCoderšŸ‡¬šŸ‡¦
StoneCoderšŸ‡¬šŸ‡¦ - avatar
+ 2
public static void main(String[] args) { Scanner scan = new Scanner(System.in); int number = Integer.parseInt(scan.nextLine()); String [] names = new String [number]; for (int i = 0; i < names.length; i++) { names[i] = scan.nextLine(); System.out.println(names[i]); } for (int i = 0; i < names.length; i++) { System.out.println( (i+1) + ". Name: " + names[i] ); } }
16th Jan 2018, 9:57 PM
mustafacqn can
mustafacqn can - avatar
+ 1
Well everything is as expected though their all on the same linešŸ˜Š. Just put all the name on a new line like above.
21st Jan 2018, 12:25 PM
StoneCoderšŸ‡¬šŸ‡¦
StoneCoderšŸ‡¬šŸ‡¦ - avatar
21st Jan 2018, 10:48 PM
Zsombor SƔndor
Zsombor SƔndor - avatar