New answers only
outcomes for this lab:
- Recursive concepts
- Uses for recursion
- Infinite recursion
- Problem solving with recursion
Say My Number
You will produce a short, elegant, recursive algorithm thatspells out any number between 1 and 2.1 billion.
Allow the user to input a number in the range from 1 to 2.1billion (a positive 32-bit int), then spell out the number (e.g.123456 would output “one hundred twenty three thousand four hundredfifty six”).
Use a recursive method “say(n)” where say(n) returns thestring corresponding to the input integer n.
The beauty of recursion is that this can be done with just a fewif statements and switch/case values (about 30 or so total),
PayPal Gateway not configured
PayPal Gateway not configured