Java Program To Create Dictionary App - Java Program Example

Here we can see a java program to create a basic name dictionary . It mean in this post share a java program to create a dictionary for search name from a to z by entered first alphabet of the name as input.

When we will compile this java program compiler take an alphabet from a to z as input and show output after compile program full name which alphabet entered by user.


Program Code

package com.androidpro.in;



import
java.util.Scanner;
import
java.util.StringTokenizer;

public class
Main {

   
public static void main(String[] args) {
        System.
out.println("Enter An Alphabet For Search Full Name");
       
Scanner ab=new Scanner(System.in);
       
String s=ab.nextLine();
       
s=s.toUpperCase();
       
System.out.println("Your name:"+s+"\nFullform:\n");
        int 
l=s.length();
        char
c;
        int
i;
        for
(i=0;i<l;i++)
        {
            c=s.charAt(i)
;
            switch
(c){
               
case 'A':System.out.println("A-Awesome\n");break;
                case
'B':System.out.println("B-Bold\n");break;
                case
'C':System.out.println("C-Charming\n");break;
                case
'D':System.out.println("D-Divine\n");break;
                case
'E':System.out.println("E-Eccentric\n");break;
                case
'F':System.out.println("F-Friendly\n");break;
                case
'G':System.out.println("G-Gregarious\n");break;
                case
'H':System.out.println("H-Heart-warming\n");break;
                case
'I':System.out.println("I-Interesting\n");break;
                case
'J':System.out.println("J-Jovial\n");break;
                case
'K':System.out.println("K-Kind\n");break;
                case
'L':System.out.println("L-Loyal\n");break;
                case
'M':System.out.println("M-Mezmerizing\n");break;
                case
'N':System.out.println("N-Naturally Witty\n");break;
                case
'O':System.out.println("O-Overwhelming\n");break;
                case
'P':System.out.println("P-Precious\n");break;
                case
'Q':System.out.println("Q-Quizzaciously Sharp-witted\n");break;
                case
'R':System.out.println("R-Rebel\n");break;
                case
'S':System.out.println("S-Supercalifragilisticexpialidocious\n");break;
                case
'T':System.out.println("T-Talented\n");break;
                case
'U':System.out.println("U-Unique\n");break;
                case
'V':System.out.println("V-Venturesome\n");break;
                case
'W':System.out.println("W-Weird\n");break;
                case
'X':System.out.println("X-Xtra-ordinary\n");break;
                case
'Y':System.out.println("Y-Yolo believer\n");break;
                case
'Z':System.out.println("Z-Zelious\n");break;
                case
' ':System.out.println("\n");break;
                default
:continue;
           
}
        }
        System.
out.println("\nIf you like the code give an upvote !\n Incase you got same adjective for repeated letters, sorry next time I will write longer code.Have a Good day. ");}


}


 Output

Output 1
Enter An Alphabet For Search Full Name
a
Your name:A
Fullform:

A-Awesome


If you like the code give an upvote !
 Incase you got same adjective for repeated letters, sorry next time I will write longer code.Have a Good day.

 

Output 2

Enter An Alphabet For Search Full Name

c

Your name:C

Fullform:

 

C-Charming

 

Post a Comment

0 Comments