013-001-003
String Handling Class: Message Formatting
Medium
Problem Description
String Handling class: Message Formatting
In this problem, you will create a program that uses String class methods (toUpperCase(), length(), substring()) to convert a string to uppercase, get its length, and extract the first 3 characters, then displays each result to standard output.
Learning Objective: Understand basic String class operations
Create a program that inputs a string and displays uppercase, length, and substring.
Input
Line 1: String
Output
Original: [original string]
Upper: [uppercase]
Length: [length]
First 3: [first 3 characters]
Example
Input:
hello
Output:
Original: hello
Upper: HELLO
Length: 5
First 3: hel
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up