Procedures Calling Procedures
Suppose we want a procedure ‘sprod’ that returns x1*y1 + x2*y2.
Abstractly we can think of this as:
sprod(x1,y1,x2,y2){
a = prod(x1,y1); #x1*y1
b = prod(x2,y2); #x2*y2
return add2(a,b); #a + b
}
Procedure ‘sprod’ calls ‘prod’ and ‘add2’.