Using the substitution model illustrate the process, C/C++ Programming

Each of the following two procedures defines a method for adding two positive integers in terms of the procedures inc, which increments its argument by 1, and dec, which decrements its argument by 1:

(define (plus1 a b)

(if (= a 0)

b

(inc (plus1 (dec a) b))))

(define (plus2 a b)

(if (= a 0)

b

(plus2 (dec a) (inc b))))

Using the substitution model, illustrate the process generated by each procedure in evaluating (+ 2 5). Are these processes iterative or recursive?

Posted Date: 3/28/2013 3:26:33 AM | Location : United States







Related Discussions:- Using the substitution model illustrate the process, Assignment Help, Ask Question on Using the substitution model illustrate the process, Get Answer, Expert's Help, Using the substitution model illustrate the process Discussions

Write discussion on Using the substitution model illustrate the process
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.   #include float start_poi

Explain procedural logic A procedure, or function, was explained as a set of specific instructions implemented in sequential manner. The data is kept separate from the procedur

Derived Data Type: Array is derived data type to store large collection of data of only one data type. int mark[100]; char names[25]; Function: will be discussed early

Program for Memory Optimization of C / OpenCL Code Project Description: This is possibly a very simple project for someone with an excellent knowledge of C and OpenCL. That,

#queComputers are frequently used in check-writing systems, such as payroll and accounts payable applications. Many stories circulate regarding weekly pay- checks being printed (by


what is classes?

I have a mini project where I need to write a code .wonder if someone can help me.I already have the forms and webmaster page done just need to code portion

Networking program development. 1.ARP protocol. 2.Switching HUB. 3.wireshark. 4.winpcap library. 5.C++ & MFC. 6.LAN evironment through switch and HUB(static ARP t

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 betw