Question: 12. Develop a Haskell function roman that takes an Int) in the range from 0 to 3999 (inclusive) and returns the corresponding Roman numeral as

 12. Develop a Haskell function roman that takes an Int) in
the range from 0 to 3999 (inclusive) and returns the corresponding Roman

12. 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. V 5 X 10 50 C 100 D 500 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 1, II. III, IV, V, VI, VII, VIII, IX, X, X, X, 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!