// Given that no person has ever lived longer than 123 years (and assuming that no one ever will), write a Java application that will determine if it is possible that anyone who is alive today is, has ever been, or will ever be alive in a year that is the square of their age.
If it is possible, your program should print out the years in which it happens and the ages that the people concerned will have in those years.
This is the code I wrote, it has no errors or anything but when I run it nothing happens. Can anyone tell me what I am doing wrong?
import javax.swing.JOptionPane;
public class SquareAge {
public static void main (String [] args) {
}
int MAX_LIFE_EXPECTANCY = 123;
int startYear = 2012; {
int age =0;
for (age=0; age<=MAX_LIFE_EXPECTANCY; age++); {
double currentYear = (startYear+age);
double currentAge = (Math.sqrt(currentYear));
double bornYear = (currentYear - currentAge);
if ((currentAge == (int)currentAge) && (bornYear <= currentYear));
{
JOptionPane.showMessageDialog (null, "currentYear, bornYear , currentAge");
}
}
}
}