010-001-003

String Operations: String Info

Medium

Problem Description

In this problem, you will create a program that takes a string as input and displays its length, uppercase conversion, lowercase conversion, first character, and last character in sequence.

Problem Overview

Create a program that inputs a string and displays information about it.

Input Format

Input 1 line of string.

Output Format

Display the following information:

Original: [original string]
Length: [character count]
Uppercase: [uppercase conversion]
Lowercase: [lowercase conversion]
First char: [first character]
Last char: [last character]

Test Cases

※ Output examples follow programming industry standards

Input:
Hello
Expected Output:
Original: Hello
Length: 5
Uppercase: HELLO
Lowercase: hello
First char: H
Last char: o
Input:
Java
Expected Output:
Original: Java
Length: 4
Uppercase: JAVA
Lowercase: java
First char: J
Last char: a
Input:
TEST
Expected Output:
Original: TEST
Length: 4
Uppercase: TEST
Lowercase: test
First char: T
Last char: T
Input:
x
Expected Output:
Original: x
Length: 1
Uppercase: X
Lowercase: x
First char: x
Last char: x
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 9 free executions remaining