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

I have a program and I want someone to fix it for me by using basic c language program.

Threaded binary tree: Consider the linked illustration of a binary tree 'T.  Approximately half of the entries is the pointer fields 'LEFT' and 'RIGHT' will have null elements. Th

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, int pos) Assuming t

#C Why don''t online compilers support the header file? What can I do to resolve this? PS. I have tried , does''nt work either. Thannk in advance.

Define global variable in c++ program: How to define a global variable and need of global variable in c++ program. int main() {    int m=20;    clrscr();    for

you are to create a text adventure game that uses pointers. You have a rich, eccentric Uncle Billy who is soon to be deceased. How soon.....oops......he''s gone. He has left yo


Ask question #M i want to undersatnd about tree structures like node leaf etcinimum 100 words accepted#

Write a C++ program that reads from keyboard 3 integers, with proper input prompt, and then displays the maximum sum of any pair of numbers from these three. If the 3 numbers are 5