Question: Develop a Haskell function roman that takes an Int) in the range from 0 to 3999 (inclusive) and returns the corresponding Roman numeral as a
Develop a Haskell function roman that takes an Int) in the range from 0 to 3999 (inclusive) and returns the corresponding Roman numeral as a string (using capital letters). The function should halt with an appropriate error messages if the argument is below or above the range. Roman numbers use the following symbols and are combined by addition or subtraction of symbols.
| I | 1 |
| V | 5 |
| X | 10 |
| L | 50 |
| C | 100 |
| D | 500 |
| M | 1000 |
For the purposes of this exercise, we represent the Roman numeral for 0 as the empty string. The Roman numbers for integers 1-20 are I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, XIII, XIV, XV, XVI, XVII, XVII, XIX, and XX. Integers 40, 90, 400, and 900 are XL, XC, CD, and CM.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
