Hey guys I am very new to programming I was practicing with a exercise question and I was doing the exercise I tried compiling the code that I already had typed, but it came back with year has not been initialized and the same error goes with investment. here is my code that I have right now. What am I doing wrong? by the way the variable future = investment * (1 + interest_rate)^year year is a exponent.
import java.lang.*;
public class Exercise63Page173
{
public static void main(String [] args)
{
int year;
double investment;
final double INTEREST_RATE = .065;
double future = investment * Math.pow((1 + INTEREST_RATE), year);
}
}