Question: Write a function called num roman that converts values between 1 and 3 9 9 9 into Roman numerals. The input will be a scalar
Write a function called "num roman" that converts values between and into Roman numerals. The input will be a scalar number and the output is a string of Roman numerals thatrepresent the input number. The function should give separate meaningful error messages if the input is less than one, if the input is greater than or if the input is an array. If no input is given the default value is The function should round a fractional value to the closest integer.For legitimate values, the function should build up a string as follows where x is the input: while x subtract from x and concatenate M to the string ifx subtract from x and concatenate CM to the string ifx subtract from x and concatenate D tothe string ifx subtract from x and concatenate CD to the string while x subtract from x and concatenate C to the string ifx subtract from x and concatenate XC to the string lifx subtract from x and concatenate L to the string ifx subtract from x and concatenate XL to the string while x subtract from x and concatenate X to the string ifx subtract from x and concatenate IX to the string ifx subtract from x and concatenate V to the string ifx subtract from x and concatenate IV to the string while x subtract from x and concatenate I to the stringConcatenate means to add text to the end of a current string no spaces!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
