Day 2: Roman Numerals


Exercise

Write a Java program to convert years written with Arabic numerals to Roman numerals.

Introduction

These are the symbols and their associated values for Roman numerals.

Symbol Value
I 1 (one)
V 5 (five)
X 10 (ten)
L 50 (fifty)
C 100 (one hundred)
D 500 (five hundred)
M 1000 (one thousand)

Use the division (/) and modulo (%) operators to determine how many of each symbol is needed in the output

Algorithm

  1. Implement the core functionality using a text-based interface for I/O.
  2. Build a GUI to wrap your implementation.

Resources

Hints


Return Home