The function mult-stream produces a stream


Produce a function mult-stream, based on the explanation in Section 8.1, that takes as input two arguments:
The first argument is a multiplier m, which is a positive integer.
The second argument is a stream strm of digits, representing the digits in the decimal representation of a number between 0 and 1. You may assume that the number does not end in an infinite string of 9's.
The function mult-stream produces a stream which is the decimal representation of the product of m with the number represented by strm. Don't worry about where the decimal point goes for this assignment. (Of course, in practice that would be very important! It's not at all hard to figure out, but it's not what I'm concerned about right here.)

Somewhere in the course of doing this, you will probably need a function which you might want to name

number->list-of-digits
which takes a non-negative integer as input and returns the list of single digits that make up the decimal representation of that integer. There are various ways to do this. One way is to use some of the built-in Scheme functions that operate on strings and characters, such as
number->string
string->list
char->integer
If you do this, please be sure to notice that char->integer returns the ASCII value of a character, so if the character is "3", for instance, what is returned from char->integer is not the number 3. So you'll have to adjust for that as well.  

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: The function mult-stream produces a stream
Reference No:- TGS088798

Expected delivery within 24 Hours