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 ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

Use 16 digit credit card numbers that contain 15 digits an 1 check digit. The format of the card number consists of the 15 digits followed by the check digit. The check digit is co

salotion of programes

Explain Rules for constructing variable names? The Rules for constructing variable names : a) A variable name is any combination of alphabets, 0 to 9 digits and undersc

Input Output Most languages have "statements" to perform I/O . Though in C and C++ we use "functions" to perform I/O. C++ also has its own I/O mechanism - the cin and cout obje

color representation 0,1,2,3,4,5,6,7...

To store a date use a structure that contains three members date, month and year. If the dates are equal then display message “Equal” otherwise “Unequal” Program structure: main()

Project Description: I posted listings on a site that is like eBay but for video games. I post the similar listing many times daily, but need something that will let me post

how to write c++ code for financial system using class and object

Here is a short program. It prints out the value of a variable "x". Ernie and Bert disagree about what will be printed: Ernie says, the value gets changed in "changeX" so it will p