Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! extracting info from lists.

Status
Not open for further replies.

Badger2008

Programmer
Nov 18, 2008
1
GB
% internal_course( Type, ListOfApplicantsResults)
% -----------------------------------------------
internal_course( theory, [(anderson,68), (caruthers,88), (framlin,22), (grant,58),
(parker,45), (theakston,45), (walters,71)
]
).
internal_course( practical, [(anderson,79), (caruthers,84), (framlin,34), (grant,61),
(parker,42), (theakston,56), (walters,67)
]
).



I am trying to write a predicate that basically takes the calculated percentage for the above courses. But the practical course is worth 1/3 of the final grade and the internal is worth 2/3 of it.. I have only just started prolog and this seems very hard to me.

K

 
write the answer you want in prolog.
for example percentage(X,Y). I need to know what type of values do you want

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top