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
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Explain zero based addressing. - Array subscripts always start at zero. - These subscript values are used to identify elements in the array. - As subscripts start at 0, a

dispaly the last ant on rod

Write a program called A1Q3, that reads it the radius of a circle as an integer and prints the circle's diameter, circumference and area.  Use a constant value for pi.  Do all calc

E v o l u t i o n of Software: In the past stage of programming the software's were developed in Machine language Using binary numbers 1's and 0's.  Later it convert

How do one throw polymorphically?               A: Sometimes people write code such as: class MyExceptionBase { }; class MyExceptionDerived : public MyExceptionBase { };

switch statement

Working Ordered linked list: • Eachinteger in the queue is stored inside of a QueueItem. The QueueItem contains the integer, and a pointer to the next item in the queue. Fo

creating a system having five process from p0 to p4 and five resource types. create the need matrix use the safe algorithm to test if the system is in safe mode.