Prolog newbie here. I have the following facts:
%marks(person, coursework_mark, exam_mark)
marks( julie, 77, 63).
marks( pete, 55, 21).
marks( chris, 69, 53).
marks( samantha, 68, 42).
marks( james, 79, 73).
and would like to write a rule that gives me the persons total mark if coursework_mark counts for 25% of the overall grade and exam_mark counts for the remaining 75%.
I've tried:
got_perc(Person,Perc):-marks(Person((_X*0.25)+(_Y*0.75)).
Please can anyone help? Thank you.
Personas a functor in the body of yorugot_percclause. You can't do expression evaluation inside of a term. Useis/2to do numeric evaluation and instantiate a variable with the result. What are_Xand_Y? - lurker