private static int calcYears(double principal, double interestRate, int compound) {
double newBalance;
int years = 0;
while (principal < 1,000,000) {
newBalance = 1+interestRate/compound;
newBalance = pow(compound, newBalance);
principal = principal*newBalance;
years++;
}
return
(
Read more... )