So I know this program IS simple, but I am still a beginner and it would be nice for someone to help me find the mistake and maybe even fix it myself so I should know how to avoid it in the future.
Basically what I'm trying to create is a simple program calculating how much money you will have after depositing your money for a certain period of time at a certain bank rate. The only condition it being that I cannot leave it after the sum doubled itself. I'm trying to do it as simple as possible, and also only use repeat until/while/for/etc.
Here's the program:
program bank;
var
k,n : real;
a : integer;
begin
writeln ('Introduce the annual rate');
readln (k);
writeln ('Introduce the initial sum');
readln (n);
writeln ('Introduce the number of years');
readln (a);
while n <= 2*n do
begin
n:= n+(k*n)/100;
a:= a+1;
writeln (a, ' ',n:0:5);
end;
writeln ('Press ENTER to continue...');
readln;
end.
EDIT: Forgot to add that I always get error 205, and the program runs properly, but after adding all the values in, it goes through a massive amount of text and just stops.