Menu
support@authoritypapers.com
+1(805) 568 7317

this is done in racket the matlab language supports a convenient notation for specif 5187955

This is done in racket.

The Matlab language supports a convenient notation for specifying ranges of numbers. The notation start:step:end denotes the range of integers start,start+step,start+2×step,…,start+n×stepstart,start+step,start+2×step,…,start+n×step, where nn is the largest integer such that start+n×step≤endstart+n×step≤end and start+(n+1)×step>endstart+(n+1)×step>end.

Note that the range may be empty if start>endstart>end. Write a scheme function (range (start step end)) which returns the list of integers equal to start:step:end.

This function will take a single rlist, (start step end), as an argument.

Example:

(
range
'(0 2 7))
=> (0 2 4 6) (
range
'(2 2 0))
=> ()

To make your code a little more legible, use the let construct:

(
define (
range rlist) (
let ( (
start
) (
step
) (
end
))
; your code here, using local variables start, step, end
))

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon
"GET15"

Order Now