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
0
votes
2 answers

New to Java, please help get my program running! Im tasked to write a program that converts integers to roman numerals

I think I have the proper code in order for the conversions to take place (thank you to user Matt Bryant for helping) but I'm confused now on how to proceed. What I've learned so far how to type code into the main body (public static void…
0
votes
1 answer

converting Roman numerals into decimal

Hey guys I think I'm really close with but I'm not too sure how to continue. All of the questions related to my problem don't really answer anything. The error that I'm getting right now is an (33): error C2064: term does not evaluate to a function…
user2726756
  • 1
  • 1
  • 1
0
votes
1 answer

Splitting string based on list values into a list in Python

At the moment I'm trying to create a new list from a string, based on matching values from another list. For example my list of values is: ['IX', 'C', 'D', 'XL', 'I', 'XC', 'M', 'L', 'CD', 'X', 'IV', 'CM'] Which are all Roman numerals. How would I…
Fergus Barker
  • 1,282
  • 6
  • 16
  • 26
0
votes
3 answers

How to convert a roman numeral to an NSNumer

I am making a calculator that has a roman numeral mode. I have the operations performed in the model view, and a view controller. My problem is that I need to convert the roman numeral to a NSNumber. There is a UILabel, and the view controller takes…
Chandler De Angelis
  • 2,646
  • 6
  • 32
  • 45
0
votes
0 answers

Can't separate code into methods without error

I'm doing a Ruby Kata (Roman numeral converter) and I'm trying to separate my code out so it's not one huge block. Here is what I have so far: def roman s total = convert s[0,1] (0..s.length).each do |i| case convert (s[i+1,1]).to_i >=…
user1029167
  • 349
  • 1
  • 4
  • 15
-1
votes
1 answer

I'm trying to write a function sum_Roman that takes integers and outputs a summation table of Roman numbers

The question itself is two parts, first part is to make a function of int_to_roman(num) that converts integers into their roman numerical counterparts, just displaying them. The second part is to use that code and make a function called sum_roman…
Spuddy
  • 19
  • 4
-1
votes
1 answer

Roman to Integer using JavaScript could not pass all tests

I am trying to solve this problem Roman to integer problem in LeetCode by using JavaScript. The code I got so far did not pass all tests. it is working only in some of the cases. for example, it passes test for "III" and it returns back 3, but for…
Kingsfull123
  • 483
  • 1
  • 6
  • 12
-1
votes
2 answers

Roman Numeral to Integers

I'm trying to write a program that converts Roman Number to integer but its compilation output the following error: Line 65: Char 5: error: conflicting types for 'main' int main(int argc, char *argv[]) { ^ Line 47: Char 5: note: previous…
-1
votes
1 answer

Index outside of bounds of the array error while trying to convert Roman numbers to Integer in C#

I am trying to write a C# program that will convert Roman numbers to Integer. I get index outside of bounds of the array error when I try short inputs. When I try long input like = "MCMXIV" (it equals to 1994) I get exactly 1994 as result. But when…
yusufukr
  • 1
  • 1
-1
votes
1 answer

function for checking incorrect roman numerals python

I am trying to write a function which takes an input of roman numerals and checking if that is a valid roman numeral. However, the user can input the function in any way that they like. I was wondering how we could check for invalid roman numerals…
-1
votes
2 answers

I dont understand why my Java code isnt reading IX as 9 but is reading LIX as 59

I am trying to create some code to read roman numerals and turn them into an integer. the issue im having is the 9s and 4s. I am able to get it to read if the 9 or 4 is inside a number (I.E LIV is 54 and LXI is 59) but by its self (IV and IX) it…
-1
votes
1 answer

The roman character to integer convertion function is not working properly

I am getting segmentation fault to this code to convert roman numerals to numbers, i am getting segmentation error when i try the program in https://www.programiz.com/cpp-programming/online-compiler/ and i found that the inside of the loop A is…
-1
votes
1 answer

Roman to Integer LeetCode

can you please tell me why my if statement isn't working properly? when roman x is before v it shoud minus 2 from the result. class Solutions: def roman_numeral(romanNum): value={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000} …
Azizur Rahaman
  • 181
  • 2
  • 5
-1
votes
1 answer

Leetcode #13 Roman to Integer Javascript

I am currently trying to solve the "Roman to Integer" question on Leetcode. My code works with roman numerals such as ("III (3)", "V (5)", "X (10)", "C (50)") for some examples. Where my code breaks down is when roman numerals such as ("IV (4)", "IX…
-1
votes
2 answers

Validation of Roman Numerals! (Java)

I have written a Java program to convert roman numerals into numbers. My only problem is if somebody enters "IIII" it shows up as 4, but instead it should give an error that it is not a valid roman numeral. I need to include the following rules into…