Answer:
The java main method that can be used to display the number of years and months to get ready for the exam is explained below.
Step-by-step explanation:
public class GetMonths {
public static void main(String[] args) {
int noofmonths = 0;
int noofyears = 0;
double percentnotknown = 100;
double percentKnown = 0;
while (percentKnown<95) {
percentnotknown *= 0.9;
percentKnown = 100 - percentnotknown;
noofmonths++;
if (noofmonths==12) {
noofyears++;
noofmonths = 0;
} // end if
} // end while
System.out.println("After "+noofyears+" years, "+noofmonths+" months,");
System.out.println("Percentage known = "+percentnotKnown);
} // end main()
} // end class