Embed
Email

Roman_Numeral_Conversion_Assignment

Document Sample

Shared by: Kerala g
Categories
Tags
Stats
views:
0
posted:
1/12/2012
language:
pages:
1
Roman Numeral Conversion Assignment



This is an exercise in string manipulation.



Be sure to:

Use proper headings (date, program name, program description, date written)

Declare all variables used in the program, use meaningful variable names and

explain their purpose.

Use indentation and spacing, particularly in loops and IF statements.





Write a program to convert a Roman numeral to its decimal equivalent.



First, do some research to understand the composition of Roman numerals.



 Accept the user’s input, ensuring that input is converted to capital letters and that

only the following Roman numerals are accepted.



I=1

V=5

X = 10

L = 50

C = 100

D = 500

M = 1000



 Special cases are created when I , X or C precede a letter of greater value

(Example: IV = 4, IX = 9, XL = 40, CM = 900, etc.)



 Determine the equivalent decimal value



 Output both the Roman numeral and its decimal value



 Allow the user to input more than one Roman numeral







BONUS: Reverse the process by allowing the user to input a decimal value and convert

it to its Roman numeral equivalent. Remember the special cases.



Other docs by Kerala g
union-budget-2012-13-highlights
Views: 103  |  Downloads: 0
notification M.Tech_05-03-09
Views: 60  |  Downloads: 0
India_Customs Regulation 1
Views: 57  |  Downloads: 0
CE Notification 39-2011-12.9.2011
Views: 55  |  Downloads: 0
STATISTICS
Views: 73  |  Downloads: 0
A Hero (R.K. Narayan)
Views: 92  |  Downloads: 6
RRBPatna-Info-HN
Views: 117  |  Downloads: 0
RRB-Notice-Para
Views: 114  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!