Question: Design and implement a function for converting an integer into Roman numerals (a string). The rules for Roman Numerals involve using four pairs of symbols
Design and implement a function for converting an integer into Roman numerals (a string). The rules for Roman Numerals involve using four pairs of symbols for ones and five, tens and fifties, hundreds and five hundreds. An additional symbol for thousands covers all the relevant bases. When a number is followed by the same or smaller number, it means addition. "II" is two 1's = 2. "VI" is 5 + 1 = 6. When one number is followed by a larger number, it means subtraction. "IX" is 1 before 10 = 9. "IIX" isn't allowed, this would be "VIII" For example, 1994 converts to 'MCMXCIV', 1956 converts to 'MCMLVI', and 3888 converts to 'MMMDCCCLXXXVIII' NOTE: you may NOT use data structures (lists, tuples, or dictionaries) that have not been covered prior to when this homework is released Draw a flowchart representing the design of your function. Submit the flowchart diagram in a file named homework8_fc.pdf Implement a function int_to_roman(num) that converts the integer argument to a Roman numeral and returns a string representation of that Roman numeral.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
