Professional Documents
Culture Documents
Problem Proper:
On your assigned programming language, create a library (containing only the functions
as described) to perform the following activities:
Function name
numToWords
wordsToNum
What it does
Accepts a whole number
from zero (0) to 1 million
(1000000; without commas
for example: 1,000,000)
and prints on screen the
number in word form
Accepts a number in
word form (from zero to 1
million) and returns it in
numerical form
Input must be in
lowercase
wordsToCurrency Accepts two arguments:
the first argument is the
number in word form
(from zero to 1 million) and
the second argument is
any of the following: JPY,
PHP, USD. The function
returns the number in
words to its numerical
form with a prefix of the
currency
numberDelimited Accepts three arguments:
the first is the number from
zero to 1 miliion, the
second is the delimiter to
be used (single character
only) and third, the
number of jumps when
the delimiter will appear
(from right most going to
left most digit)
Sample Input
1234
Sample Output
one thousand two
hundred thirty four
one thousand
two hundred
thirty four
1234
one thousand
two hundred
thirty four,
USD
USD1234
1234,,,3
1,234