how can we calculate the years until graduation for some inputs?

Your untilGrad method should be;

int year = Calendar.getInstance().get(Calendar.YEAR);
return gradYear-year;

Your goal is to find the number of years until their graduation year. This involves getting the current year via Calendar.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top