Hi all
This is what the problem is and I believe is wrong
Financial application: computing future tuition) Suppose that the tuition for a university is $ 10,000 this year and increases 5% every year. Write a program that uses a loop to compute the tuition in ten years. Write another program that computes the total cost of four years worth of tuition starting ten years from now.
Calculate the sum of years 11 - 12 - 13 and 14
This is what I have so far
import java.util.Scanner;
public class tuition02 {
public static void main(String [] args) {
//Declare variables
double tuition = 10000;
int year = 1;
double tuitiontotal = tuition;
//Loop
while (year <= 10){
tuition = ((tuition * .05) + tuition);
year++;
}
System.out.println("The tuition in ten years is: " + tuition);
while (year <= 14){
tuition = tuition * 1.05;
tuitiontotal = tuitiontotal + tuition;
year++;
}
System.out.println("The total cost of 4 years is: " + tuitiontotal);
}
}
this is my output
The tuition in ten years is: 16288.946267774414
The total cost of 4 years is: 83717.76425901077
Process completed.
and I believe the answer is
73717.76425901076
please help
Thanks in advance