Categories
Java

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();
	}

}
Categories
Java

Feet To Inch Conversion in Java

 In this tutorial, I will show you how to create a menu-driven program to convert feet to the inch and vice versa using Java programming language. I hope you will like my program.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;
import java.math.RoundingMode;
import java.text.DecimalFormat;

public class Feet_Inch {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		  Scanner scan = new Scanner(System.in);
		  DecimalFormat df = new DecimalFormat("#.##");
	      df.setRoundingMode(RoundingMode.CEILING);
		  
	      System.out.println();
		  System.out.println("===== Feet To Inch Conversion in Java =====");
		  System.out.println();
		  System.out.println("[1] Feet to Inch Conversion");
		  System.out.println("[2] Inch To Feet Conversion");
		  System.out.println();
		  System.out.print("Selection your option : ");
		  int ch= scan.nextInt();
		  
		  if (ch==1) 
		  {
		   System.out.println();
		   System.out.print("Give Feet Value : ");
		   double feet = scan.nextDouble();
		   double inch = feet*12;
		   System.out.println();
		   System.out.println("The feet(s) equivalues is  "+df.format(inch));
		  }
		   
		  else if (ch==2) 
		  {
		   System.out.println();
		   System.out.print("Give Inch Value : ");
		   double inch = scan.nextDouble();
		   double feet= inch/12;
		   System.out.println();
		   System.out.println("The feet(s) equivalues is  "+df.format(feet));
		  }
		   
		  else
		  {
		   System.out.println("Invalid Option. Please Try Again.");
		  }
		  System.out.println();
		  System.out.println("=====   END OF PROGRAM =====");
		  System.out.println();
	}

}