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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started