+ 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
7 Antworten
+ 11
Something like this !!
https://code.sololearn.com/cFjADc99qoTN/?ref=app
+ 13
@John Dooe
Really !! as The Best !! 😆
Thanks a lot mate !! 👍
&&
I'm really honored !! 🤗
+ 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...
+ 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] );
}
}
+ 1
Well everything is as expected though their all on the same line😊.
Just put all the name on a new line like above.
+ 1
Here is my solution!
https://code.sololearn.com/cWA8ksLdPzVy/#py