Challenge: Name Initials

Lab Java Beginner 10 points

Read a first name and a last name (one per line) and print the initials in capital letters, with a dot after each.

Input

Two lines: first name, then last name.

Output

For asha and verma, print A.V.

Example

Input

asha
verma

Output

A.V.
Sample input available Sample output available
Editor
Java

Hints

charAt(0) gives the first character.

Character.toUpperCase(c) makes it a capital.

Start the print with a String so that + joins instead of adding char codes.

Solution explanation

Because a + "." involves a String, Java joins the characters as text. a + b on its own would add their code numbers!

Show solution
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String first = sc.nextLine();
        String last = sc.nextLine();
        char a = Character.toUpperCase(first.charAt(0));
        char b = Character.toUpperCase(last.charAt(0));
        System.out.println(a + "." + b + ".");
    }
}
Output
Answer
HOME LABS COMMUNITY DASHBOARD