physical exercise 31.three.3
develop an accumulator-style model of product, the purpose that
computes the product of the record of numbers. display the stage that explains
what the accumulator represents. solution
physical exercise 31.three.4
build an accumulator-style edition of how-many,
Microsoft Office Home And Business 2010, which is the function
that determines the number of items on a listing. show the stage that explains
what the accumulator represents. solution
exercise 31.3.5
build an accumulator-style edition of add-to-pi,
Microsoft Office 2010 Professional, the operate
that adds a natural number to pi without using + (see
section ). indicate the stage that explains what the
accumulator represents.
generalize the purpose so that it adds two numbers,
Office Professional Plus 2010 Key, the first one a natural
number,
Windows 7 Pro, without using +. solution
exercise 31.3.6
build the operate make-palindrome, which accepts a non-empty
list and constructs a palindrome by mirroring the record around the last
item. thus, if we were to represent the word ``abc'' and apply
make-palindrome,
Office 2007 Professional Plus, we would get back the representation of
``abcba''. solution
exercising 31.three.7
build to10. it consumes an inventory of digits and produces the
corresponding number. the first item on the listing is the most significant digit.
examples: