Write a program that takes an integer and returns it in words. e.g. 123 -> one hundred
Question:
Write a program that takes an integer and returns it in words. e.g. 123 -> \"one hundred and twenty-three\". We want the program not to be language-specific and later it would be possible to add new languages. This flexibility is solved so that the words associated with the numbers are key-value pairs in the files associated with the program. Initially, you must be able to work in the program in French and English. As the formation of words denoting numbers differs in different languages, we also want to solve this difference with the help of a translation file. Therefore, if something is irregular, there must be a separate translation. If the program does not find a translation for a number, it compiles it according to the general rule. The program should report certain errors by throwing an exception. These situations are described in the program tests. A quality program is one that is as flexible as possible and with as little duplication as possible.
Introduction To Programming In Java An Interdisciplinary Approach
ISBN: 9780672337840
2nd Edition
Authors: Robert Sedgewick, Kevin Wayne