![]() |
|
#1
|
|||
|
|||
Roman numerals to decimalPlz someone help me with C++ programm!
I need enter in programm big letters... and if thay comply with Roman numerals than i need convert this Roman numeral to decimal... example V - 5 VII - 7 ABVT - error! It's not Roman number. 76 - error! It's not Roman number. Plz help... i can't make myself... I don't understand C++ i just learning. I see on forum other Roman numerals to decimal Threads, but there wasn't correct programms which works. Plz somebody write this programm here |
|||
|
#2
|
|||
|
|||
Re: Roman numerals to decimalQuote:
These are two very different requests. There are a number of people here who may be able to help you with the first request. Most will not simply write the code for you, but we like to try to help people learn to implement and debug their own programs. Most of the time just posting an assignment and saying something like, "I don't know how to do it," will not get a helpful response. The idea is that you use what you learned in class or in some previous class to start the program. If (when) you get to a part that doesn't work the way you expect or if you write and test part of the code but are stuck for ideas about how to proceed, then. 1. Post the code that you have so far. 2. Ask specific questions about parts that you don't understand. Like this: "When I tried to compile the program, the compiler gave the following message(s) that I didn't understand: ... or Like this: "The program compiled without any warning or error messages, but then I gave the program the following input:... I expected the following output:..., but the program (crashed) (gave the following wrong output..) (whatever...)" Regards, Dave |
|
#3
|
|||
|
|||
Re: Roman numerals to decimalQuote:
Did you take a look at: www.gidforums.com :davis: |
|
#4
|
|||
|
|||
Re: Roman numerals to decimalYes i take a look at that link... but somebody with that program is not good. I little bit change it because there was things what i don't need but still in my and that programm is something wrong.
CM is 900 but the programm convert CM to 1100 XC is 90 but the programm convert XC to 110 or i write IIIDDDMMMCCCXXXIDCMX and programm convert it to 6444 ... I think it's not correctly too. I don't realy know what problem there is! Can somebody help me with it? That program don't convert correctly from Roman to decimal. =( PHP Code:
|
|
#5
|
|||
|
|||
Re: Roman numerals to decimalQuote:
There is no system("pause") on my system, so I didn't bother to take a look at your code. Why don't you use a simple FSM for managing the states of your deciphering? :davis: |
|
#6
|
|||
|
|||
Re: Roman numerals to decimalQuote:
Note that CM is not valid Roman. A smaller numeral never "starts" the number. The larger must start first, therefore: CM is not valid XC is not valid IIIDDDMMMCCCXXXIDCMX is not valid If you want 90, you will use: LXL or LXXXX If you want 900, you will use: DCD or DCCCC ...noting that my original code didn't work properly for any of these. A reasonable choice would be to use a simple FSM and parse through the numeral appropriately using transitions in state accordingly. The intention of my original code (other than being only 10-minutes of effort) was to give the original poster an opportunity to consider some other ways of looking at the problem through the implementation choices available in C++. It wasn't meant to be a perfected example of properly handling the problem...and I called out that it was clearly not working properly. However, it should give you (or anybody) at least an idea of how to go about writing it. :davis: |
|
#7
|
|||
|
|||
Re: Roman numerals to decimalWith all due respect
Quote:
Quote:
Quote:
Keep in mind, Davis, that a finite state machine might be a trivial endeavor for you, but many people have no idea what FSM stands for -- you shouldn't assume and be so judgemental. |
|
#8
|
|||
|
|||
Re: Roman numerals to decimalQuote:
Well, if I was perfect, I'd charge a LOT more! However, I pulled all of that from memory (being rather old and feable minded) rather than checking (like I probably should have done) Wikipedia or other sources. While it may be easy to say not to be judgmental (we drop the "e" on judge), we all are always judgmental about everything. That fact gives us the ability to distinguish right from wrong and make similar comparisons about everything else...including who we let our kids play with, what web sites we surf, what channels we watch and what food products we consume...and a whole lot more. The mere mention of an FSM for someone who doesn't know what it is suggests to me that if that person is industrious, then s/he will look it up and discover what it means. If the person lacks the motivation to determine the meaning, then there is no reason for me to explain it at any length. I'm not saying that I'm "right," but I'm not likely to change my "methods" anytime soon, either. But, thank you for your comments. :davis: |
|
#9
|
|||
|
|||
Re: Roman numerals to decimalPlz somebody show me what code i need to change or delete! I'm just not good in english therfore i need that somebody show me the code. I don't need all c++ programm... just show what i need to change in this programm...
PHP Code:
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help writing a roman numeral to decimal program | Ichigo | C++ Forum | 3 | 23-Mar-2006 15:05 |
| Frustrating C++ problem... Roman numerals | Elsydeon | C++ Forum | 10 | 01-Sep-2005 08:37 |
| Help with a C++ Program (Converting Roman Numerals) | royrules22 | C++ Forum | 1 | 11-Jul-2005 01:01 |
| Roman to decimal to roman | SpudNuts | C++ Forum | 2 | 16-Feb-2005 20:44 |
| Hex Result giving strange answers. | Rosdahale | C Programming Language | 6 | 07-Dec-2004 21:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The