I just started learning loops in java and given this exercise: Suppose that the tuition for a university is $40,000 this year and tuition increases 3% every year. Write a program that uses a for loop to compute the tution in 10 years.
This is my code so far and now I'm stuck on how to use the for loop to calculate the fee each year. Help?
Its not working correctly I need help
public class Exercise2{ public static void main(String[] args){ int sum=0; int fee; //Prints 10 statements for(int i=1; i<11; i++){ for(fee=1; fee<11; fee=(40000*(3/100))) //Calculates the fees fee++; System.out.println("The tution fee for year "+i+" is "+fee); //Results } } }
This is my code so far and now I'm stuck on how to use the for loop to calculate the fee each year. Help?
Its not working correctly I need help