# how do i display a roman numerals from ordinary numbers??

Show 80 post(s) from this thread on one page
Page 3 of 3 First 123
• 07-05-2011
King Mir
Converting 9 is easy, because you only have to deal with one digit. A look up table does the trick.

A more instructive example is converting a number like 909. In this case you must first convert the 900, then deal with the remainder. So 909 is CM followed by the converted form of 9.
• 07-05-2011
whiteflags
Quote:

yes..i thought that your getting what i mean whiteflags??
But the important thing is, are you getting what I mean? It doesn't matter if I understand it. You are the student here.

Quote:

then what kind of operators i will use..??
From my example, we see the numbers getting smaller so you will have to subtract the value of the numerals you write down from the number you convert each time. Then you append the numeral to the string. If you don't know strings, you need to learn their basic usage before attempting this. You also need first grade math skills.
Quote:

when i write a algorithm flowchart and solution..can you give a example code??
Sample code, for a problem like this, is as good as solution code. I will not give a working sample of this problem. After you get some work done, I will be happy to correct your work.

Quote:

when converting 9??i will use it as a guidelines..
You need to save the digits answers in memory. Eventually you'll get to single digits and it will be the easiest thing to append to the answer.
• 07-05-2011
whiteflags
Quote:

Originally Posted by King Mir
A more instructive example is converting a number like 909. In this case you must first convert the 900, then deal with the remainder. So 909 is XC followed by the converted form of 9.

Especially instructive since it's either CMIX, DCDIX, or DCCCCIX....
• 07-06-2011
Elysia
How many times we must repeat this? First you make a flowchart! Forget all about coding! Forget all about headers, operators, if statements, switch cases, etc.
Do we need an algorithm to write a flowchart? No.
Can we deduce an algorithm from a flowchart? Yes.

How does one write a flowchart, then? One starts doing the mental exercise by hand and writing down the steps one takes.
If you cannot do that, then you are beyond help.
• 07-06-2011
laserlight
Quote:

Originally Posted by Elysia
Do we need an algorithm to write a flowchart? No.

I would say "yes", since a flowchart is a way to express an algorithm. You cannot express what you don't have. The point though is that a flowchart (or my preference: pseudocode) allows you to express an algorithm without caring about the specifics of programming language syntax or other nitty gritty details that you have to take care of to have a correct program.
• 07-06-2011
Elysia
Clearly arguable, but what I mean to say is that you don't need to know an algorithm beforehand to start writing a flowchart. A flowchart is best at making up an algorithm as you go.
• 07-07-2011
SteveHan
Quote:

Originally Posted by Elysia