Newbie
Hello, a newbie here, just starting Java Programming. I'm currently taking up Information Technology.
Can somebody help me with the right programming for this?
Exercise 3: String Manipulation Program
Instructions:
Create a program that asks the user for their full name and performs various string operations on it.
Program Requirements:
Prompt user to enter their full name
Extract first name and last name separately
Display the name in different formats:
All uppercase
All lowercase
Proper case (first letter of each word capitalized)
Initials only
Count and display the number of characters (including spaces)
Count and display the number of characters (excluding spaces)
Check if the name contains specific letters or words
Sample Output:
Enter your full name: john michael smith
=== Name Analysis ===
Original Name: john michael smith
First Name: john
Last Name: smith
Middle Name: michael
=== Name Formats ===
UPPERCASE: JOHN MICHAEL SMITH
lowercase: john michael smith
Proper Case: John Michael Smith
Initials: J.M.S.
=== Character Count ===
Total characters (with spaces): 18
Total characters (without spaces): 16
Number of words: 3
=== Name Validation ===
Contains 'john': true
Contains 'z': false
Valid full name: true (contains spaces)
9 Replies
⌛ This post has been reserved for your question.
Hey @chelsi! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Read up on the Scanner and on the String class
Scanner (Java SE 24 & JDK 24)
declaration: module: java.base, package: java.util, class: Scanner
String (Java SE 24 & JDK 24)
declaration: module: java.base, package: java.lang, class: String
thank you.
And, how many months you've been doing Java before you became a programmer? your strategies?
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
@bassus
Uhh, you program something, than you are a programmer 🤷♂️
I would advice learning the basic principles of object orientation if you wanna learn java
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.