Name Generator in Java

Language
This is a simple java program that will generate the letter or a word that you have been inputted into a bigger letter or word using asterisk (*) symbol. Sample source code:
  1. import java.util.*;
  2. /**
  3.  * @title Name generator :D
  4.  *@version 1.0
  5.  * @author Sherwin Pitao
  6.  *
  7.  */
  8. public class Name {
  9.  
  10.     public static void main(String[] args) {
  11.        
  12.         System.out.print("Enter your Name[Small Caps Only]:");
  13.         Scanner in = new Scanner(System.in);
  14.         String inputedName= in.nextLine();
  15.         String Wordd="";
  16.         String[] alp={"   *\n  * *\n *****\n*     *\n\n",  /*A*/
  17.                       "******\n*     *\n******\n*     *\n******\n\n",/*B*/
  18.                       " *****\n*     *   \n*\n*     *   \n *****\n\n",/*C*/
  19.                       "******\n*     *\n*     *\n*     *\n******\n\n",/*D*/
  20.                       "*******\n*\n*****\n*\n*******\n\n",/*E*/
  21.                       "*******\n*\n*****\n*\n*\n\n",/*F*/
  22.                       " *****\n*     \n*   ***\n*     *\n *****\n\n",/*G*/
  23.                       "*     *\n*     *\n*******\n*     *\n*     *\n\n",/*H*/
  24.                       "*******\n   *\n   *\n   *\n*******\n\n",/*I*/
  25.                       "*******\n      *\n      *\n*     *\n *****\n\n",/*J*/
  26.                       "*     *\n*  *\n**\n*  *\n*     *\n\n",/*K*/
  27.                       "*\n*\n*\n*\n*******\n\n",/*L*/
  28.                       "*     *\n**   **\n*  *  *\n*     *\n*     *\n\n",/*M*/
  29.                       "*     *\n**    *\n*  *  *\n*   * *\n*     *\n\n",/*N*/
  30.                       " *****\n*     *\n*     *\n*     *\n *****\n\n",/*O*/
  31.                       "******\n*     *\n*     *\n******\n*\n*\n\n",/*P*/
  32.                       " *****\n*     *\n*   * *\n*    **\n ***** *\n\n",/*Q*/
  33.                       "******\n*     *\n*     *\n******\n*    *\n*     *\n\n",/*R*/
  34.                       " *****\n*          \n *****\n*     *\n *****\n\n",/*S*/
  35.                       "*******\n   *\n   *\n   *\n   *\n\n",/*T*/
  36.                       "*     *\n*     *\n*     *\n*     *\n *****\n\n",/*U*/
  37.                       "*     *\n*     *\n*     *\n *   *   \n   *\n\n",/*V*/
  38.                       "*     *\n*     *\n*  *  *\n* * * *\n *   *\n\n",/*W*/
  39.                       "*     *\n *   *\n   * \n *   *\n*     *\n\n",/*X*/
  40.                       "*     *\n *   *\n   * \n   *\n   *\n\n",/*Y*/
  41.                       "*******\n      *\n     *\n   *\n  *\n*******\n\n"/*Z*/};
  42.        
  43.        
  44.         String[] pla={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
  45.                       "p","q","r","s","t","u","v","w","x","y","z"};
  46.         int ctr = inputedName.charAt(0);
  47.        for(ctr=0;ctr<inputedName.length();ctr++){
  48.            Wordd=inputedName.charAt(ctr)+"";
  49.            for(int r=0;r<pla.length;r++){
  50.                if(Wordd.compareTo(pla[r])==0){
  51.                    System.out.print(alp[r]);}
  52.                
  53.            }
  54.            
  55.        }
  56.    
  57.        
  58.     }
  59. }

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Tags

Add new comment