How to produce a function mult-stream

Assignment Help Computer Engineering
Reference no: EM132487

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.

 

Reference no: EM132487

Questions Cloud

Determine ordering cost per order : Determine ordering cost per order
How large would the salvage value of the automated equipment : How large would the salvage value of the automated equipment have to be to make the investment in the automated equipment financially attractive?
Elements to be considered in the design of a workstation : What is a workstation? What are the main elements to be considered in the design of a workstation. How would you improve the design of a standing workstation by the application of sound ergonomic principles.
Evaluate profit and loss for given case : Write journal entries for each transaction and Evaluate profit and loss for given case
How to produce a function mult-stream : How to produce a function mult-stream.
Write journal entries for each transaction : Write journal entries for each transaction and What is Nicole's Getaway Spa's gross profit percentage?
Define and explain workplace violence : Define and explain workplace violence. What are the various forms of workplace violence? Illustrate your answer with various examples.
Program on wireless connection technology : Program on wireless connection technology.
Explain why lumbar belts are not very effective : Briefly describe a good handling technique that could be adopted by a person required to lift a load from the ground Explain why lumbar belts are not very effective in preventing back injuries at work

Reviews

Write a Review

Computer Engineering Questions & Answers

  Type of data standard

What type of data standard are we dealing with in each scenario (metadata, spatial or attribute)? You work for Town of Ancaster prior to an amalgamation of New City of Hamilton. Your main responsibility was to retain Town's single line road network f..

  What devices use to get efficient network communication

CNT Books has expanded considerably as you first got network up and running three years ago. It at the present occupies an entire floor in building, and its LAN has full-grown to contain several servers and more than 60 workstations.

  Which references source page fault with lru page replacement

Which references source a page fault with LRU page replacement policy? Illustrate your intermediate working in table below with three columns.

  Calculate the component voltages

Input voltage will be a step voltage that is 0 volt before time t = 0 and V in

  How to generate 2 instances of time and date

generate an application that uses both Time and Date classes How to generate 2 instances of Time and Date

  Spreadsheet model of the heat transfer situation

Spreadsheet model of the heat transfer situation

  Bourne shell and design suitable functions

Bourne shell and design suitable functions

  Risk assessment of ict system

Risk Assessment of ICT System and Developing Computer Incident Response System on WAMP platform

  Design a data structure which supports two operations

Design a data structure which supports two operations 1. Insert(S, x) inserts x into S. 2. Remove-Duplicates(S) removes from S all duplicated values.

  Explain the method to find cost of sorting the relation

Explain the method to find cost of sorting the relation In each case, how many combine passes are required?

  Illustrate precedence graph

Illustrate precedence graph

  How to write a class named dayofyear that gets an integer

How to write a class named DayOfYear that gets an integer Day 2 would be January 2 Day 32 would be February 1 Day 365 would be December 31

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd