I am trying to finish (start) an assignment and I can't get passes what should be a simle parse error. It shows up on the case line of the information function. I have to get rid of it to continue on... and I have tons more to do... Any one able to help? (if you have more suggestions I could sure use them)
Program Calculations (input, output);
VAR
option:integer;
loan, monthInterest, years :integer;
months:integer;
monthPayment,yearInterest:real;
factor,saved,information:integer;
//information:real;
calculation:integer;
PROCEDURE GetInfo(Var option :integer);
BEGIN
writeln;
writeln ('Please enter one of the following options:');
writeln (' 1 - Figure out monthly payments for a loan amount');
writeln (' 2 - Figure out loan amount for a desired monthly payment');
writeln (' 3 - Figure out how much money can be sved over a number of years');
writeln (' 4 - Figure out how much needs to be saved to hit a target amount');
readln (option);
END;
FUNCTION calc (months:real):real ;
BEGIN
calc := exp(months* LN(1+monthInterest));
END;
PROCEDURE GetMoreInfo (loan, monthDeposit, years,NeedSave:integer;
monthInterest :real);
BEGIN
IF (option = 1) THEN
Begin
writeln ('Enter your loan amount, yearly interest and years of loan');
readln (loan, monthInterest, years);
months := (years *12);
END;
IF (option = 2) THEN
BEGIN
write ('Enter your desired monthly payment, yearly interest');
writeln ('rate, and the number of years to the loan ');
readln ( monthPayment, yearInterest, years);
monthInterest := (yearInterest /12);
months := (years *12);
END;
IF (option = 3) THEN
BEGIN
write (' Enter the amount you will save, interest rate and ');
writeln ('number of years');
readln (monthDeposit, yearInterest, years);
monthInterest := (yearInterest /12);
months := (years *12);
END;
IF (option = 4) THEN
BEGIN
write ('Enter the amount you want to save, the yearly ');
writeln ('interest and the number of years');
readln (NeedSave,monthInterest, years);
monthInterest := (yearInterest /12);
months := (years *12);
END;
END;
FUNCTION information :real ;
Case option OF
1 : information :=factor * monthInterest*loan/(factor-1);
2 : information := (factor-1)*monthPayment/(factor*monthInterest);
3 : information := (factor-1)*monthDeposit/monthInterest;
4 : information := NeedSave *monthInterest/(factor-1);
END;
{Case option OF
1 : MonthPayment :=factor * monthInterest*loan/(factor-1);
2 : amount := (factor-1)*monthPayment/(factor*monthInterest);
3 : saved := (factor-1)*monthDeposit/monthInterest;
4 : monthDeposit := NeedSave *monthInterest/(factor-1);
END;}
Begin
GetInfo (option);
GetMoreInfo (loan, monthDeposit, years,NeedSave, monthInterest);
factor := calc ;
calculation := information;
writeln;
writeln ('Press <Enter> to end this program');
readln;
End.