Skip to content

cygni/TDD-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Roman Numerals

From Wikipedia

The numeric system represented by Roman numerals originated in ancient Rome and remained the usual way of writing numbers throughout Europe well into the Late Middle Ages. Numbers in this system are represented by combinations of letters from the Latin alphabet. Roman numerals, as used today, are based on seven symbols:

Symbol Value
M 1000
D 500
C 100
L 50
X 10
V 5
I 1

Note that Roman numerals are not defined for zero or negative numbers!

The solution

Build a small utility that can convert Arabic numbers to Roman numerals. Develop the solution by using a TDD style.

Extra materials

  • Make a wrapper so that the program can be called from the command line with a list of Arabic numbers
  • Write a solution for converting in the opposite direction.

Some test data

Arabic Roman
-1 error
0 error
1 I
5 V
15 XV
42 XLII
9 IX
94 XCIV
1776 MDCCLXXVI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published