Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
roman
- Page 1
Re: Roman Numerals (Python)
Programming
Software Development
15 Years Ago
by woooee
… arabic = 0 for n in range(0, len(
roman
)-1): this_char =
roman
[n] next_char =
roman
[n+1] if (this_char in roman_to_decimal) and \ (… break if converted: ## add last
roman
numeral arabic += roman_to_decimal[
roman
[len(
roman
)-1]] print "\nThe
roman
numeral",
roman
, "is equal to"…
Re: roman numeral calculator problems
Programming
Software Development
17 Years Ago
by robotnixon
…; [*]int convertToDecimal(string&) [*]{ [*] [*] char
roman
[20]; [*] int length = strlen(
roman
); [*] int number = 0; [*] int counter =…operation; [*]cout << "Enter a
roman
expression." << endl; [*]cin&…;< endl; [*]cout << "Enter a
roman
expression." << endl; [*]} [*] return 0;…
Roman Numeral to Arabic Converter
Programming
Software Development
16 Years Ago
by Straightone
… most coding is from Arabic to
roman
but i need from
Roman
to Arabic. [CODE=Python]from string… 500 "M" == 1000
roman
= upper(raw_input("Enter the
roman
numeral to convert to arabic: "))…== 1000 if
roman
[0] >
roman
[1]: arabic =
roman
[0] +
roman
[1] print "The
roman
numeral",
roman
, "Is …
Re: roman numeral calculator problems
Programming
Software Development
17 Years Ago
by Lerner
… convertToDecimal(char *
roman
); int main() { char
roman
[10]; cin >>
roman
; int num = convertToDecimal(
roman
); } int convertToDecimal(char *
roman
) { int length = strlen(
roman
); int number…
Roman numer rules validating
Programming
Software Development
15 Years Ago
by moods125
…<SIZE; x++) { if(findIt(
roman
[x]) < (findIt(
roman
[x+])) integerValue-=findIt(
roman
[x]); else integerValue+=findIt(
roman
[x]); } return integerValue; } /////////////////////////////////////////////////////////////////////////////// bool isValidRoman…
roman numeral calculator problems
Programming
Software Development
17 Years Ago
by robotnixon
… with at least two functions (decimal->
roman
,
roman
->decimal). I started by designing three … [*]int sum; [*]int solution; [*]int result; [*]int convertToDecimal(string
roman
) [*]{ [*] char romanNum[100]; [*] [*] cin >> romanNum… operation; [*]cout << "Enter a
roman
expression." << endl; [*]cin>&…
Re: Roman Numeral to Arabic Converter
Programming
Software Development
16 Years Ago
by GrimJack
Do not forget that anywhere in the string that if a numeral is smaller than the one that comes next, it is subtracted from the the one that comes next: [code]# if
roman
[0] >=
roman
[1]: # arabic =
roman
[0] +
roman
[1] Else arabic =
roman
[1] -
roman
[0][/code] Or something like that.
Re: Roman Numerals to Arabic Numbers and Vice Versa
Programming
Software Development
14 Years Ago
by ibthevivin
…; break; default: throw new std::out_of_range( "Not a valid
Roman
numeral!" ); break; } } } int getArabic() { return m_arabic; }…quot;; std::string
roman
; cin >>
roman
; try { RomanNumeral rn(
roman
); cout << "
Roman
Numeral: " <<
roman
<<…
Roman to Integer and back conversion - "illegal call of non-static member function"
Programming
Software Development
13 Years Ago
by Griff0527
…a function "romanToDecimal" to convert
Roman
numerals into its equivalent decimal number. 3)…//Function to convert decimal numbers to
Roman
numerals //Postcondition: outputs
Roman
numeral equivilents of the decimal input…[10]; cout << "Please enter a
Roman
Numeral: "; //Prompt user cin >> roman_num…
Re: roman numeral calculator problems
Programming
Software Development
17 Years Ago
by robotnixon
…]# int convertToDecimal(string&) # { # char
roman
[20]; Try int convertToDecimal(char
roman
[20]) Or better yet, make
roman
your std::string variable. By…;); int sum; int main () { cout << "Enter a
roman
numeral: "; convertToDecimal(sum); cout << "The decimal…
Re: Roman Numeral to Arabic Converter
Programming
Software Development
16 Years Ago
by shadwickman
… need to call it by saying [code=python]
roman
= raw_input("Enter the
roman
numeral to convert to arabic: ").upper() [/code…
Re: roman numeral calculator problems
Programming
Software Development
17 Years Ago
by Salem
# int convertToDecimal(string&) # { # char
roman
[20]; Try int convertToDecimal(char
roman
[20]) Or better yet, make
roman
your std::string variable. By leaving the parameter unnamed, you're passing a value, but totally ignoring it. Do you have a debugger? If so, now is the time to get used to using it.
roman numerals
Programming
Software Development
17 Years Ago
by mikky05v
…to help ease the program’s complexity: 1. The following
Roman
numerals, with their Arabic equivalents, must be handled: I…M – 1000 2. The Middle-Ages extension of the
Roman
numeral system which intended to shorten notations (such as replacing…zero, and it does not have to work with
Roman
numerals larger than 1,000. so what would …
Re: Roman Numeral to Arabic Converter
Programming
Software Development
16 Years Ago
by GrimJack
Just being my pedantic self, you are changing inputted
Roman
Numerals to Hindi numbers- the Arabs borrowed the numbers from India (in Arabic they are known as 'Indian numbers' - arqa-m [B]hindi[/B]yyah)
Re: Roman Numeral to Arabic Converter
Programming
Software Development
16 Years Ago
by Straightone
…;837487]Just being my pedantic self, you are changing inputted
Roman
Numerals to Hindi numbers- the Arabs borrowed the numbers from…
Roman Numeral to Decimal Converter
Programming
Software Development
16 Years Ago
by gretty
… converter but I am having trouble doing it from
roman
to decimal. How do you pull a string apart letter …;iostream> using namespace std; int numeral_converter(int a); void
roman
(int a, int b, int c, int d); int main…; << one << endl;
roman
(one, ten, hund, tho); return a; } void
roman
(int a, int b, int c, int…
Re: roman numeral calculator problems
Programming
Software Development
17 Years Ago
by robotnixon
I changed this: [inlinecode] int convertToDecimal(string&) { char
roman
[20]; int length = strlen(
roman
); [/inlinecode] My output is in the correct format but there's no answer.
Re: roman numeral calculator problems
Programming
Software Development
17 Years Ago
by Lerner
…. Remove all mention to romanNum by replacing every appearance to
roman
in convertToDecimal(), or rename the variable passed to convertToDecimal() from…
roman
to romanNum. Between line 33 and 34 of the original …
Re: Roman numer rules validating
Programming
Software Development
15 Years Ago
by Lerner
line 43: you need some way to stop the loop. using a line like: while(!valid); should do it. line 84 should be: return true; else how are you going to indicate that all char in the input are valid char for a
roman
numeral?
Re: roman numeral calculator problems
Programming
Software Development
17 Years Ago
by Lerner
Intinalize sum to zero in convertToDecimal() before you try to add something to it. You never use the values passed to convertToDecimal() in the form of
roman
. Instead, you ask for additional input in the form of romanNum.
Re: roman numeral calculator problems
Programming
Software Development
17 Years Ago
by robotnixon
… use the values passed to convertToDecimal() in the form of
roman
. Instead, you ask for additional input in the form of…
Roman Numerals to Arabic Numbers and Vice Versa
Programming
Software Development
14 Years Ago
by ibthevivin
… a program that will convert
Roman
numerals to Arabic numbers or Arabic numbers to
Roman
numerals. Your program should prompt…of conversion they would like to perform,
Roman
to Arabic or Arabic to
Roman
, and allow them to convert as many… they would like." Here's a quick refresher for
roman
numerals: M = 1000 D = 500 C = 100 L = …
Re: Roman to Integer and back conversion - "illegal call of non-static member function"
Programming
Software Development
13 Years Ago
by Griff0527
Thanks, that worked DeanMSands3. It appears that my logic for
Roman
to decimal is skewed. MMCI comes out with 100 instead of 2101. Likewise MCMXI comes out to 1900 instead of 1911. I'm looking at my logic now, but a second (or third) set of eyes would be much appreciated.
Re: Roman to Integer and back conversion - "illegal call of non-static member function"
Programming
Software Development
13 Years Ago
by Griff0527
…() { char roman_num[10]; cout << "Please enter a
Roman
Numeral: "; //Prompt user cin >> roman_num; //Receive input…
Re: Roman to Integer and back conversion - "illegal call of non-static member function"
Programming
Software Development
13 Years Ago
by Lerner
To me
roman
numerals are read left to right so: MCMXLIV = 1000 + (1000 − 100) + (50 − 10) + (5 − 1) = 1944 which is an example I found on Wikipedia.
Re: Roman to Integer and back conversion - "illegal call of non-static member function"
Programming
Software Development
13 Years Ago
by raptr_dflo
Oh, and at some point you should add some error checking, because even if you get your existing logic correct, "IC" isn't a valid
roman
numeral.
Re: Roman numerals help
Programming
Software Development
13 Years Ago
by darkagn
… something like: [code] int temp = inputValue; string
roman
= String.Empty; while (temp > 999) {
roman
+= "M"; temp -= 1000; } while (temp…;C"; temp -= 100; } while (temp > 89) {
roman
+= "XC"; temp -= 10; } // and so on... [/code] There …
Re: roman numerals
Programming
Software Development
17 Years Ago
by mikky05v
…=0; string roman_numeral; cout<<"Please enter a
Roman
Numeral (Note that IV is 6 not 4)"<…
Re: roman numerals
Programming
Software Development
17 Years Ago
by mikky05v
…=0; string roman_numeral; cout<<"Please enter a
Roman
Numeral (Note that IV is 6 not 4)"<…
Re: roman numerals
Programming
Software Development
17 Years Ago
by Sky Diploma
… main() { string roman_numeral; cout<<"Please enter a
Roman
Numeral (Note that IV is 6 not 4)"<…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC