In this tutorial, I will show you how to check the person's age if the person is still a minor or already an adult using Java programming language.
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 at my email address also. Thank you.
My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com
My mobile number here in the Philippines is 09173084360.
/* Persons_Age_Checker.java
* Mr. Jake Rodriguez Pomperada,MAED-IT, MIT
* www.jakerpomperada.com www.jakerpomperada.blogspot.com
* jakerpomperada@gmail.com
* Bacolod City, Negros Occidental Philippiens
*/
import java.util.*;
public class Persons_Age_Checker {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int age=0;
Scanner input = new Scanner(System.in);
System.out.println();
System.out.print("\tPerson's Age Checker in Java ");
System.out.println("\n");
System.out.print("Enter your age: ");
age = input.nextInt();
if(age <= 17)
{
System.out.println("\nYour age belongs to MINOR.");
}
else
{
System.out.println("\nYour age belongs to an ADULT.");
}
System.out.println();
System.out.print("\tEnd of Program");
System.out.println();
}
}
No comments:
Post a Comment