Using Dr-Racket, what is the purpose of the
number function?
(define (number n)
(local [(define (abstract int)
(* int 11))] (build-list n abstract)))
A) Create a list of the first n multiples of 11 starting at 11.
B) Create a list of the first n multiples of 11 starting at 0.
C) Create a list of the first n multiples of 11 starting at 1.
D) Create a list of the first 11 multiples of n starting at 1.
E) Create a list of the first 11 multiples of n starting at
0.
F) Create a list of the first 11 multiples of n starting at n.
SOLUTION
The given code makes a function named number that takes an arguement "n".
And it prepares a list of "n" multiples of 11 starting from 0.
Let me explain the underlying concept .
Inside the function it is creating an abstract function that takes an integer and then the expression (* int 11) is responsible for multiplication .Then the next expression calls the abstract function passing "n" as arguement.
PROOF:
SO the correct option is B
Get Answers For Free
Most questions answered within 1 hours.