B
bartc
Nick said:p-code is supposed to look like something?
Since I once wrote a p-code standard then I suppose the answer is yes!
I thought you meant pseudo-code. And not Lisp (or something that looks
suspiciously like it, probably Scheme if that .scm is a clue).
but where's the fun in that? The intent was not to help the person
who was too idle to do his own homework. My code avoided adding
implementation details like for loops and closely modelled the
solution given in the question.
Sometimes pseudo code has to spell out loops and things, as I'm not sure how
well list-ops are 'standardised' in it. Otherwise you might as well just use
the OP's solution as the path from that to C would be simpler than from your
p-code.
CGPA = ( ∑CHi GPi ) / (∑CHi )