import java.io.*;
import java.util.*;
public class Year2{
Scanner scan=new Scanner(System.in);
int year=0;
public void input()throws Exception{
System.out.println("Enter any Year: ");
year=scan.nextInt();
do{
if(year<400){
do{
System.out.println("Re-enter the year (year>=400): ");
year=scan.nextInt();
if(year<400){
for(int i=1; ; i++){
System.out.println("Re-enter the year (year>=400): ");
year=scan.nextInt();
}
}
}
while(year<400);
}
}
while(year<400);
}
public void compute(){
if(year%400==0)
System.out.println("Year "+year+" is Centurien Leap Year.");
else
System.out.println("Year "+year+" is not Centurien Leap Year.");
}
public static void main(String[] args)throws Exception{
Year2 obj=new Year2();
obj.input();
obj.compute();
}
}
import java.util.*;
public class Year2{
Scanner scan=new Scanner(System.in);
int year=0;
public void input()throws Exception{
System.out.println("Enter any Year: ");
year=scan.nextInt();
do{
if(year<400){
do{
System.out.println("Re-enter the year (year>=400): ");
year=scan.nextInt();
if(year<400){
for(int i=1; ; i++){
System.out.println("Re-enter the year (year>=400): ");
year=scan.nextInt();
}
}
}
while(year<400);
}
}
while(year<400);
}
public void compute(){
if(year%400==0)
System.out.println("Year "+year+" is Centurien Leap Year.");
else
System.out.println("Year "+year+" is not Centurien Leap Year.");
}
public static void main(String[] args)throws Exception{
Year2 obj=new Year2();
obj.input();
obj.compute();
}
}
Comments