Folks,
I'm just starting out on Jess and have set myself the initial task of
writing a small program concerning granting loans. The system will ask the
user various questions to see if they qualify for a loan, and if they do
will calculate how much they will be able to borrow. The first part (whether
they qualify) is fine, but I can't figure out how to get Jess to read in a
number, do some maths on it and return the value.
In Pascal I would do something like this:
procedure loan_size
BEGIN
if qualifies(person) {if they qualify for a loan - I can establish this in
Jess)
then
writeln('what is your annual salary?');
readln(salary);
calc_amount(salary);
END;
I would then need a function or procedure called calc_amount:
procedure calc_amount(annual_salary)
BEGIN
loan_size := annual_salary * 3; {the bank will lend 3 times
salary};
writeln('you can borrow ', loan_size);
END;
I have been unable to translate this sort of thing into Jess syntax or to
find any roughly parallel examples. If anyone could offer a translation or
make any suggestions I'd be very grateful.
Also, any suggestions about a relevant book or teaching materials would be
excellent.
Thanks in anticipation
David
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------