Description
PROGRAM #02
Write a program in which will use some of the built-in METHODS as it relates to the use of Strings.
1) The program will ask the user the following prompts:
Please enter your first name and their last name, separated by a space. This program will then read-in the user’s response using Scanner. You must separate the string input entered by the user into two strings via substrings. Substring one will store the first name and Substring two will store the last name respectively. ***hint this can be accomplish using the indexOf() to find the position of the space. Your program must display/output the number of characters in each name, as well as the user’s initials that was entered. You must check and trim all extra white spaces before and after the string entered by the user. Incorporate and loop to have this program ask this user if they would like to execute the program again by prompting and requesting a Y for Yes and a N for No. This prompt should ignore upper or lower case entries. The initials are the first letter of the first name together with the first letter of the last name.
Hello their Louis I have your first name as Louis, which has 5 characters
Hello again Louis I have your last name as Henry, which has 5 characters
Did you know that your initials are LH
Do you wish to continue (Y)Yes or (N)No ?
Reviews
There are no reviews yet.