Saturday, May 8, 2021

Alphabet Checker in Java

 In this tutorial, I will show you guys how to create a Java program to ask the user to give a character, and then the program will check if the given character is an alphabet or not.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com






Program Listing

/**

 * @author Jake Rodriguez Pomperada,MAED-IT, MIT

 * www.jakerpomperada.com    www.jakerpompomperada.blogspot.com

 * jakerpomperada@gmail.com

 * Bacolod City, Negros Occidental Philippines

 *

 */

import java.util.Scanner;


public class Alphabet_Checker {


/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

Scanner scan = new Scanner(System.in);

    

  System.out.println();

  System.out.println("===== Alphabet Checker  in Java =====");

  System.out.println();

  System.out.print("Give a Alphabet : ");

  char char_given = scan.next().charAt(0);

  

  System.out.println();

    // checks if char_giv  is an alphabet

    if (Character.isAlphabetic(char_given)) {

      System.out.println("The given " + char_given  + " is an alphabet.");

    }

    else { 

      System.out.println("The given " + char_given + " is not an alphabet.");

    }

      System.out.println();

  System.out.println("=====   END OF PROGRAM =====");

  System.out.println();

}


}


No comments:

Post a Comment