Questions tagged [roman-numerals]

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).

Roman numerals on Wikipedia

273 questions
4
votes
1 answer

In Java repeating prompt until all chars in string are acceptible

I'm fairly new to java and trying to make a roman numeral calculator. I have the main coding done but I want to add the ability to check for "illegal" characters in the main string. I have created a method called "ValidCheck" to test all chars in…
4
votes
3 answers

Converting roman numerals to arabic

I'm new to Java and I need to write a program that converts roman numerals to arabic numbers. I cannot use some functions because I'm not allowed to change the begging neither the end of the given code. I need to do everything inside the the public…
Rods2292
  • 665
  • 2
  • 10
  • 28
4
votes
4 answers

Roman numbers to decimal numbers, getting garbage value

I have to create a program for converting Roman numerals to decimal numbers for which I'm getting garbage value as an output. The fact is I have double checked my logic and it seems to be correct. How can I correct it? Here's my…
Sahil Dhawan
  • 91
  • 2
  • 14
4
votes
1 answer

Overline in console programming

Just a quick question. For the roman numerals above 3999, we used to represent them using a overline. For representing 4000, we will be using the following: So, to display this overline, what should I do? Also, please advice me which of the above…
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
4
votes
1 answer

Can Roman Numerals be printed instead of an int?

I have some code which prints some small numbers (actually years) and the request is to have the numbers printed as Roman numerals instead of using the usual Hindu-Arabic numerals: int main() { // do something to make all integers appear in…
Dietmar Kühl
  • 150,225
  • 13
  • 225
  • 380
4
votes
8 answers

Help me improve this Erlang?

So I'm really interested in Erlang. I can't find an excuse to use it for anything big, but I try to use it for toy problems from time to time. Right now, I'm implementing a Roman Numeral translator. I'm just doing the "to" part for now, and I'm…
Adam Bard
  • 1,693
  • 1
  • 11
  • 17
4
votes
1 answer

Prolog Roman Numerals (Attribute Grammars)

I am working on an assignment in prolog that scans a list of numerals and should return whether the list is a valid roman numeral and the decimal value of the numerals. Ex) 1 ?- roman(N, ['I'], []). N = 1 true. 2 ?- When I run the program that I…
Ross Verry
  • 115
  • 8
3
votes
3 answers

MySQL Custom Function to Turn Roman Numeral Into Arabic

Ok, I need a MySQL Function that will convert a Roman Numeral String: e.g. XXCVI Into its Arabic numbering equivalent. Its a long story as to why I need it, I just do. Based on a PHP function that someone posted, I created the following MySQL…
Doug
  • 6,446
  • 9
  • 74
  • 107
3
votes
3 answers

Relate Roman and Arabic numerals

How to relate Roman and Arabic numerals up to 899999 in a pure manner? And this time without using arithmetic! Thus without (is)/2 nor clpfd/clpz/clpq. Lacking any means to relate to integers, Arabic numerals have to be represented as a list of…
false
  • 10,264
  • 13
  • 101
  • 209
3
votes
4 answers

Extract roman numerals from string in python

I have a list of strings, containing chords represented as Latin Numerals like this: ['ii7', 'vi7', 'V', 'IVadd9', 'Iadd9', 'V', 'IVmaj7', 'ii7', 'vi7', 'V', 'IVadd9', 'Iadd9', 'V', 'IVmaj7'] and I want to split these strings into 3 sublists, like…
ZookKep
  • 481
  • 5
  • 13
3
votes
1 answer

Converting roman numbers in arabic numbers -- recursiv

i´m new to JavaScript and learning with the Help of the Website https://www.jshero.net/koans/roman1.html. The exercise is to code a converter, that converts roman numbers from a string 'CDLXXXIII' to the arabic number. I made a code with a "while…
Marcel
  • 33
  • 3
3
votes
3 answers

Roman to decimal conversion

What do you think about this code? Is it the best way? Any improvement? Roman.h #ifndef ROMAN_H #define ROMAN_H #include #include typedef unsigned long int UL_I; typedef std::map< std::string, UL_I, std::less< std::string > >…
fpointbin
  • 1,633
  • 3
  • 16
  • 20
3
votes
1 answer

Regex matching punctuation and roman in lowercase

Possible Duplicate: How do you match only valid roman numerals with a regular expression? Hi, How do I match regex to something like [i]) [ii]) [iii]) [iv]) and so on... Thanks
y2p
  • 4,791
  • 10
  • 40
  • 56
3
votes
1 answer

Octave/MATLAB Function to Convert Roman Numeral Into Decimal Number

I'm trying to write a function in Octave to convert roman numerals into decimal numbers. What I have so far has two major problems: 1) It will only work for roman numerals up to 6 letters in length 2) The answer is only correct if each letter is…
3
votes
5 answers

How to convert Roman numerals to int while rejecting invalid numbers using standard C?

What it means to be proper Roman numerals may vary. For simplicity (no Unicode, no multiplicative principle, no double subtractives, no overbars, no large numbers, etc) for the sake of this question, valid Roman numerals are defined by the regex:…
jfs
  • 399,953
  • 195
  • 994
  • 1,670
1 2
3
18 19