Describe the behaviour of procedure, C/C++ Programming

Observe that our model of evaluation allows for combinations whose operators are compound expressions.

(a) Use this observation to describe the behavior of the following procedure:

(define (a-or-b-depending-on-value a b)
((cond ((< b a) +) ((= b 0) -) ((= a 0) /) (else *)) a b))

Your answer should describe what happens for all integer values of a and b. Illustrate your answer using the substitution model assuming applicative order evaluation.

(b) Write a procedure (check-it op p q r) that returns #t if p op q = r and #f otherwise. For example, (check-it * 3 2 6) would return #t as 3 * 2 = 6.

 

Posted Date: 3/25/2013 1:50:56 AM | Location : United States







Related Discussions:- Describe the behaviour of procedure, Assignment Help, Ask Question on Describe the behaviour of procedure, Get Answer, Expert's Help, Describe the behaviour of procedure Discussions

Write discussion on Describe the behaviour of procedure
Your posts are moderated
Related Questions
Rules of Operator Overloading It is a function defined to an operator with new term or meaning. It cannot produce new operator. It cannot modified the meaning of th

explain me for loop


if one won't explicitly call the destructor of a local; then how does he handle the above situation?

how to use nested loop of for in array


Addition in a existing c++ unification algorithm Project Description: I have a existing code for a algorithm and need to add two modules into it, it is a unification algorith

Help me evaluate suitable OpenCV filters to get an inital working tracking algorithm. In this case it's objects moving on water (sea) and since I have very limited OpenCV knowledge

luminous jewel polishing necklace, c/c++ programming

C Program for MULTIPLICATION TABLE   main() {           int a, b=1, c, d;           char ch;           clrscr();           while(ch!='n')           {