Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question

Produce a function mult-stream, 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 digits in the decimal representation of a number between 0 and 1. You may suppose that number does not end in an infinite string of 9's.

The function mult-stream makes a stream which is the decimal representation of product of m with number represented by strm. Don't worry about where 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.)

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

number->list-of-digits
that takes a non-negative integer as input and returns the directory of single digits that make up decimal representation of that integer. There are a variety of ways to do this. One way is to use some of 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 will have to alter for that as well.

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9718159

Have any Question?


Related Questions in Computer Engineering

Ssk software has their main office in sylvania ohio and

SSK Software has their main office in Sylvania Ohio and remote locations in Chicago, Toledo, Cleveland and Cincinnati. SSK Software currently has 62 devices connected to the network in Chicago, 30 computers in Toledo, 60 ...

At steady-state the output of a pid controller is 10ma when

At steady-state, the output of a PID controller is 10mA. When the process is upset, the set-point signal increases at a rate of 0.4 mA/min. If the controller gain, reset time, and derivative time are 3, 2 min, and 0.4 mi ...

A 2500ml sample of sulfuric acid a diprotic acid was

A 25.00mL sample of sulfuric acid, a diprotic acid, was titratedwith 24.66mL of aqueous NaOH. Upon evaporation, 0.550g of drysodium sulfate was recovered. a. What is the normality of the sulfuric acid b. What this the no ...

Using c language how to write a function name bsqrt that

Using C++ language, how to write a function name bsqrt that will compute the square root of a number using the Babylonian method. This function will take the number x to compute the square root for and the number of iter ...

1 why is it unlikely for magnesium to form a cation with a

1) Why is it unlikely for magnesium to form a cation with a charge of +1? 2) How can you tell whether disilicon hexabromide is considered an ionic or molecular compound according to its formula or name?

Stack implemented with slldesign and code your own lifo

Stack implemented with SLL Design and code your own LIFO Stack using single liked list to hold a list of integers. Use the C++ "struct" structure to create your SLL nodes. Node position numbering should start with one. Y ...

When using todays digital cameras file sizes are often

When using today's digital cameras file sizes are often saved in a format that is well over 1 Megabyte. This may be great for high definition photo reproductions but is a disaster for uploading to the web. Images on your ...

Assume that the pizza market consists of two firms conans

Assume that the pizza market consists of two firms, Conan's and Pizza Hut. The price of a Conan pizza is denoted by Pc and the price of a Pizza Hut Pizza is P h.  Both sellers have a marginal cost of $5 for another pizza ...

Discuss how today the internet has brought millions of

Discuss how today, the internet has brought millions of unsecured computer networks into communication with each other.

Annual demand and supply for the mylan company is given

Annual demand and supply for the Mylan company is given by: QD = 5,000 + 0.5 I + 0.2 A - 100P, and QS = -5000 + 100P where Q is the quantity per year, P is price, I is income per household, and A is advertising expenditu ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As