Question: Write a Scheme function int-to-words that takes a nonnegative integer between 0 and 99, inclusive, as a parameter and returns a list of words corresponding
Write a Scheme function int-to-words that takes a nonnegative integer between 0 and 99, inclusive, as a parameter and returns a list of words corresponding to the integers reading in English. Make your function as short as possible; i.e., dont write a COND statement with 100 tests. Example calls to your function are given below:
(int-to-words 13) ; should return (thirteen)
(int-to-words 42) ; should return (forty two)
Note, in order to simplify things, we are not expecting dashes in the output (i.e., 42 is output as forty two not forty-two). Hint: You may want to use the built-in integer division functions quotient and remainder.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
