Answer to Question #298077 in Java | JSP | JSF for Deaton

Question #298077

Write a program to take a name as input then display the signature as the first letter of each word with dot.

Enter a String

Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr

H.B.W.S.


1
Expert's answer
2022-02-15T13:57:56-0500


import java.util.*;


class App {


	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("Enter a String: ");
		String words[] = in.nextLine().split(" ");
		for (int i = 0; i < words.length; i++) {
			System.out.print(words[i].toUpperCase().charAt(0) + ".");
		}


		in.close();
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS