The Roman numeral system is an ancient way of representing numbers. The base symbols are I (1), V (5), X (10), L (50), C (100), D (500) and M (1000).
Questions tagged [roman-numerals]
273 questions
0
votes
2 answers
how to get a roman numeral calculator to work with negative numbers
The roman numeral calculator wont work when the result form the calculator is negative,
i honestly don't know how to fix it.
When the calculator gives out a positive value everything works fine
for example the result will look like this
please…

Laura Herrera
- 13
- 1
- 3
0
votes
2 answers
Roman number to decimal in Java
I have to make a program that converts Roman numbers to decimal. I am confused about how to write the conditions for the Roman numbers, such as IV (4), IX (9), XL (40) and CM(900). The code that I wrote works for all the other numbers.
public static…

GT123
- 1
- 5
0
votes
2 answers
Random addition in Roman numeral translator
I need to convert roman numerals to integer values, order does not matter. (9=VIIII)
In the present I start to get a fudge factor from my code, it starts at 20 by the time that I have implemented X and reaches 530 by the time I reach M. I can't…
0
votes
1 answer
Program is Chopping off First Interger
I have this method which is supposed to convert roman numerals into integers, however when I put in roman numerals it chops off the first letter, so when I put in "IV", I get 5 rather than 4. Earlier I had the same issue, but only it was chopping…
0
votes
2 answers
Matlab convert integer to roman
I am trying to convert integer x (0<=x<=3999) to Roman numeral y.
I wrote codes for this, but I keep getting an error when I run.
What is a problem of this…

Grace
- 7
- 3
0
votes
1 answer
Roman Numeral to Integer: what is wrong with my code
So I'm trying to make a converter from roman numerals to integers. What I have so far is this:
public int toNumber(String n){
int number = 0;
int first = 1;
int last = 0;
String substring = n.substring (last, first);
…

Matt
- 3
- 2
0
votes
4 answers
why the code does not respond and keep runing?
I am writing a program that translates from Roman numerals to decimal numbers.
For some reason it does not return the value when it checks the user's input. However it already fixed,
what I'm facing right now is: The code does not respond me the…

bscouth
- 9
- 2
- 8
0
votes
2 answers
Arabic to Roman converter: ArrayIndexOutOfBounds
I am making an Arabic to Roman numeral converter and getting the error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at arab2Roman.arabicToRoman(arab2Roman.java:27)
at arab2Roman.main(arab2Roman.java:178)
Any…

Tim Koehler
- 29
- 6
0
votes
3 answers
Convert Numerical Value to Roman Numeral
I need to convert a numeric value to a roman numeral value by using different methods. Below is the code that i have created already.
public static void main (String[]args){
Scanner in = new Scanner(System.in);
int input = in.nextInt();
…

Michael
- 13
- 7
0
votes
1 answer
create a list from the individual values of one number
I am creating a way to convert an Arabic Numeral into a Roman Numeral. If the Arabic numeral to be converted is 124 I would like to create a list List that contains the values 100, 20, and 4. So basically I need to somehow find the base 10…
user3896917
0
votes
1 answer
Roman Numeral to Arabic
My function is part of a Roman Numeral to Arabic conversion function. It evaluates fine where there is a pair CM, a pair CD, where there is a single character C, and for all the combinations of CM, CD, M, D and C.
However, where the final character…

MiltsInit
- 153
- 7
0
votes
7 answers
Roman numbers subtract without conversion
Is possible to subtract roman numbers without conversion to decimal numbers?
For Example:
X - III = VII
So in input I have X and III. In output I have VII.
I need algorithm without conversion to decimal number.
Now I don't have an idea.

Norbert Pisz
- 3,392
- 3
- 27
- 42
0
votes
2 answers
Roman Numeral Checker (takes input and checks if a valid roman numeral)(Java)
I would like some help with this please, and if you guys come up with some fancy out of my league way of doing it, just explain it.
Im sure with a huge IF or a SWITCH I could do this, but there has to be a more optimized way. I was thinking…

user2963396
- 21
- 1
0
votes
1 answer
Refactoring Roman Numeral Kata in Javascript
I am newbie working on the Roman Numeral Kata in Javascript.
All specs are passing. I have refactored the spec file and am now trying to refactor the main file.
What used to look like this:
function roman(number) {
var conversion = ''
if…

user3245240
- 265
- 4
- 10
0
votes
1 answer
Refactoring Javascript Specs for the Roman Numeral Kata
I'm a newbie programmer currently working on the Roman Numeral Kata in Javascript. I've solved it at all specs (I'm using Jasmine) are passing. However, I have a lot of duplication in my specs. Here are just the first two:…

user3245240
- 265
- 4
- 10