java program to define a method to accept a person dat of birth and return true if he is eleigible to vite in the year 2009otherwise return false
Answers
Answered by
1
import java.util.Scanner;
public class EligibletoVote
{
public static void main (String args[])
{
int age;
Scanner sc = new Scanner(System.in);
System.out.print(“Enter year of birth:”);
year= sc.nextInt();
if(year< 1991)
System.out.println(“Not eligible to vote”);
else
System.out.println(“eligible to vote”);
}
Similar questions