Question: Java code where the user enters their name, they are required to enter their first and last name as a single entry. Add code to
Java code where the user enters their name, they are required to enter their first and last name as a single entry. Add code to ensure that they do this.
There should be a space in between the
first and last name (Any leading or trailing spaces vould be ignored)
Examples
of valid names;
- John Smith
- J Smith
- John S
Examples of invalid names:
- Smith
- John
- John C (leading Spaces
are to be ignored)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
