roman code python help , C/C++ Programming

In general, Roman numerals can be converted mathematically by simply assigning a numerical value to each letter, according to the chart below, and calculating a total:
M=1000 | D=500 | C=100 | L=50 | X=10 | V=5 | I=1
Although the historical practice has varied, the modern convention has been to arrange the letters from left to right in order of decreasing value; the total is then calculated by adding the numerical values of all the letters in the sequence.

For example, MDCLXVI (one of each valid letter) = 1000 + 500 + 100 + 50 + 10 + 5 + 1 = 1666.

A well-known, but still often confusing feature of modern Roman numerals is the subtraction principle, which requires that a lower numeral appearing before a higher one be subtracted from the higher value, not added to the total. For example, IX is the Roman numeral for 9 (that is, 10 - 1). In the same way XIX represents the number 19 (X + IX, or 10 + 9) rather than 21, which is written as XXI (10 + 10 + 1). Likewise the Roman numeral for the year 1995 is usually written as MCMXCV (M + CM + XC + V, or 1000 + 900 + 90 + 5). Many other similar examples can be found which strictly follows this subtraction convention.

Another present-day convention is the avoidance of more than three consecutive occurrences of the same letter in favor of the more succinct forms achieved by using the subtraction principle -- for example, IV for IIII (4), XL for XXXX (40), and CD for CCCC (400). An exception is the numeral M, or 1000, which is used 4 times to represent our number 4000, since the Romans had no single-letter numeral representing a higher value than M. It is now also customary not to repeat the values V, L, or D (5, 50, or 500) in the same numeral.
Posted Date: 1/22/2013 7:06:48 PM | Location :

Related Discussions:- roman code python help , Assignment Help, Ask Question on roman code python help , Get Answer, Expert's Help, roman code python help Discussions

Write discussion on roman code python help
Your posts are moderated
Related Questions
Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should

I am seeking a developer to create a mobile game for me. I want an endless runner game with simple controls. The game needs to be a 3D game in a 2D view. The graphics and animation

what is the difference between call by reference and call by pointer method?

We move a high quantity of large Video files (200mb - 2 GB each) across the internet. We have a Linux server (ubuntu) hosted in a datacenter (1Gbps) operating an FTP server. Our

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

write a javaprogram to solve padovan string using java? program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring;

Program is to find the area of room: Program is to find the area of room with default values using classes & object class room   {   private:     int len;     i

Define Bitwise-AND Operator: &:? The bitwise-AND operator (&) compares every bit of its first operand to the corresponding bit of its second operand. If both bits are 1 the mat

Write a C function to solve the system of linear equations A x = y where A is an N by N matrix in the format of pointer-to-pointers and y is a vector in the format of a pointer. Th