Easy Roman Numeral Conversion

The following letters are the only upper case letters with their values:

Letter Value

A. I 1

B. V 5

C. X 10

D. L 50

E. C 100

F. D 500

G. M 1000

Note: the Subtraction Principle is used when the value of the first of two consecutive different Roman Letters is less than the second.

Rule #1: the only time the subtraction principle applies is with the Roman letters I, X, or C. The only letters that can immediately follow I, X, or C with value greater than I, X, or C are the next two letters of higher value. Example: IV is 4, IX is 9, but IL is illegal.

Rule #2: all Roman letters must be in lower case or all Roman letters must be in upper case.

Rule #3: Any sequence of three Roman letters cannot be nondecreasing except if the letters are all the same.

Rule #4: V, L, or D appears at most once.

M, C, or X appears at most four times.

I appears at most three times

Rule #5: M must appear first or second with a C preceding the M.

if M appears second with C preceding M then both M and D cannot appear again in the string.

if M starts the string then there can be at most three M's in a row followed by either CM, or CD, or D or a string of C's.

The rules for what may follow C, X, are similar.

## Deliverables

1) Complete and fully-functional working program in executable form as well as complete source code of all work done.

Extra notes: (not included in 'Description')

Input to the program should be either a string of characters representing a Roman Numeral or an Arabic Number and in either case spaces are not allowed.

Error-check the input code whether the input is correct or not. (You may either delete the spaces or copy the input string to another string without spaces.)

The program should either:

1)Convert a string of digits (Max. value, say 3999) to a Roman Numeral using the least amount of letters to represent the Arabic number, or

2) Convert a string of Roman Numerals to an Arabic number in an efficient way.

* please document well; each function should be described as to what the function does and what it returns. each of the function's parameters and local variables should be described as to how the parameters and local variables are modified, and how the parameters are used.

** Functions should be written w/only a few lines of code; they should be tested out completely.

## Platform

windows (2000, NT, XP, 98)

use MS Visual C++

Habilidades: Programação C, Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Veja mais: what is a string in programming, use case sequence, php programming notes, notes php programming, efficient php programming, easy c programming, c.v. example, c programming string functions, allowed program lines in php, roman numerals conversion, what is a w-9 form, w-9 what is it, w ix, roman s, roman m, roman iv, copy of w-9, s parameters, roman, ix, document conversion, d conversion, b v, work done easy, roman number

Acerca do Empregador:
( 3 comentários ) United States

ID do Projeto: #2987022

Concedido a:


See private message.

$7 USD em 3 dias
(122 Comentários)

3 freelancers estão ofertando em média $6 para esse trabalho


See private message.

$7.65 USD in 3 dias
(96 Comentários)

See private message.

$3.4 USD in 3 dias
(0 Comentários)