any number to roman numeral conversion

can anybody here help me with my pascal program on convertion of a number to roman numeral? pls? pls? pls? and one thing more, will pascal and visual basic run on windows vista? your help would be very much appreciated... thank you!

Comments

  • : can anybody here help me with my pascal program on convertion of a
    : number to roman numeral? pls? pls? pls? and one thing more, will
    : pascal and visual basic run on windows vista? your help would be
    : very much appreciated... thank you!

    It should work on Vista. Never hurts to try. Also, what in specific do you need help with for your conversion program?
  • : : can anybody here help me with my pascal program on convertion of a
    : : number to roman numeral? pls? pls? pls? and one thing more, will
    : : pascal and visual basic run on windows vista? your help would be
    : : very much appreciated... thank you!
    :
    : It should work on Vista. Never hurts to try. Also, what in specific
    : do you need help with for your conversion program?
    : thanx.. i haven't tried installing it here in my pc... i'm scared... by the way, i'm working out on my program on how i can convert any num up to 3,000 to roman numerals... but i dont know where and how to start. this is the first time i've encountered a problem that would require me to create my own function/procedure. and i need to workon its algorithm and flowcharting, too.. if it's not too much to ask, pls tell me the right thing to do. thanks, sir...

  • : : : can anybody here help me with my pascal program on convertion of a
    : : : number to roman numeral? pls? pls? pls? and one thing more, will
    : : : pascal and visual basic run on windows vista? your help would be
    : : : very much appreciated... thank you!
    : :
    : : It should work on Vista. Never hurts to try. Also, what in specific
    : : do you need help with for your conversion program?
    : : thanx.. i haven't tried installing it here in my pc... i'm scared... by the way, i'm working out on my program on how i can convert any num up to 3,000 to roman numerals... but i dont know where and how to start. this is the first time i've encountered a problem that would require me to create my own function/procedure. and i need to workon its algorithm and flowcharting, too.. if it's not too much to ask, pls tell me the right thing to do. thanks, sir...
    :
    :
    I've seen questions about converting decimal numbers to roman and back again several times before. Perhaps it helps if you search these forums to find those question and the approaches described in the answers.
    Your basic program structure should be a loop over the decimal number. Within that loop you need to convert each digit to the correct roman equivalent.
  • : : : can anybody here help me with my pascal program on convertion of a
    : : : number to roman numeral? pls? pls? pls? and one thing more, will
    : : : pascal and visual basic run on windows vista? your help would be
    : : : very much appreciated... thank you!
    : :
    : : It should work on Vista. Never hurts to try. Also, what in specific
    : : do you need help with for your conversion program?
    : : thanx.. i haven't tried installing it here in my pc... i'm scared... by the way, i'm working out on my program on how i can convert any num up to 3,000 to roman numerals... but i dont know where and how to start. this is the first time i've encountered a problem that would require me to create my own function/procedure. and i need to workon its algorithm and flowcharting, too.. if it's not too much to ask, pls tell me the right thing to do. thanks, sir...
    :
    :
    Hmm, a good start might be too declare what values your roman numerals would be in the constant area. Do you have any of the program started yet or are you just starting from scratch?

  • I will explain you the application in question.
    But, you have to do it by yourself ... (if you want so) ...

    So, I will start with the "pseudo-algorithm", does that exist ?,
    but anyway, this is not an algorithm, neither pseudo-code, but
    it the first step on every application development. Understand what you want to accomplish.

    [size=2]IT'S UP TO YOU TO ANSWER ME, IN THIS THREAD, WITH AN ALGORITHM, IF YOU WANT TO CONTINUE WITH THIS. (YOU HAVE TO SHOW ME IN YOUR ALGORITHM YOU UNDERSTOOD THIS). IF THAT'S NOT THE CASE, I LOST MY TIME AND BETTER LOOK IN OTHER POST WHERE I POSTED THE FULL SOURCE CODE IN JAVA. (If you want to)[/size]

    ------------------------------------------------------

    Pseudo-algorithm ... (Does that exist?)

    In this example we are going to convert a value from Arabic to Roman, to make it easy I choose 2945.

    We make acknowledge of meanings :
    [code]1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1
    "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"[/code]
    First, we take the number and divide by the most highest Roman value we can have. In this case the most highest value is 1000 which is represented by "M" on Roman numeric system.

    2945 / 1000 = 2.945

    Then, we concatenates the figure "M" so many times as the integer result from the previous division; and we get "MM" (2 times) which means 2 thousands.

    Now, we make the same division but store only the modulus of such operation, (the modulus is the remainder of a integer division) and make it our new number to work with.

    2945 % 1000 = 945

    Then, our new number is 945, we make the same operation on the first step, but now we use 900 which is represented by "CM".

    945 / 900 = 1.05

    Again, we repeat the step of concatenation of the figure in question, so many times as the integer result from the previous operation; and we get "CM" (1 time, is impossible to have something different 1 or 0, but still important because we can get 0). We add the first concatenation which gave us "MM", so we get "MMCM" which means 2900.

    So, we repeat the modulus operation again with the corresponding values "now in turn".

    945 % 900 = 45

    Ok, now we repeat the previus operations, you had two examples by now, so i will simplify ...

    45 / 500 = 0 (The real thing is 0.09, but the 0 is what matters)

    This step gave us nothing to add, but still has to get the remainder,

    45 % 500 = 45

    Hey, like you saw, nothing happended, because 500 is not inside 45 (it's not divisible). We make the same steps with 400, 100, 90, 50 ... and those gave us nothing too. Until 40 ... we make the same operations again ...

    45 / 40 = 1.125
    45 % 40 = 5

    Now we got 1 in the division, so we concatenates "XL" which means 40 so many times as the integer division (1 time). And with the previous result of "MMCM" we got earlier, we got "MMCMXL", now we have 2940.

    We made the same steps with 10, 9 and got nothing.
    At 5, we have to do the same procedure and we add "V".
    Now we have "MMCMXLV" which means 2945.

    Still have to do it with 4 and 1, because the number could have been 2944 or 2947, but with the same procedure we will get the correct result.

    Now we have the result and display on the screen.

    MMCMXLV = 2945.

    the most highest value on roman is m (small m).
    it means a billion or something like that, in this example I will not use it. (Even when is the same procedure)

    [red]Good luck![/red]
    [blue]Hackman[/blue]
  • :
    : I will explain you the application in question.
    : But, you have to do it by yourself ... (if you want so) ...
    :
    : So, I will start with the "pseudo-algorithm", does that exist ?,
    : but anyway, this is not an algorithm, neither pseudo-code, but
    : it the first step on every application development. Understand what
    : you want to accomplish.
    :
    : [size=2]IT'S UP TO YOU TO ANSWER ME, IN THIS THREAD, WITH AN
    : ALGORITHM, IF YOU WANT TO CONTINUE WITH THIS. (YOU HAVE TO SHOW ME
    : IN YOUR ALGORITHM YOU UNDERSTOOD THIS). IF THAT'S NOT THE CASE, I
    : LOST MY TIME AND BETTER LOOK IN OTHER POST WHERE I POSTED THE FULL
    : SOURCE CODE IN JAVA. (If you want to)[/size]
    :
    : ------------------------------------------------------
    :
    : Pseudo-algorithm ... (Does that exist?)
    :
    : In this example we are going to convert a value from Arabic to
    : Roman, to make it easy I choose 2945.
    :
    : We make acknowledge of meanings :
    : [code]: 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1
    : "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"[/code]:
    : First, we take the number and divide by the most highest Roman value
    : we can have. In this case the most highest value is 1000 which is
    : represented by "M" on Roman numeric system.
    :
    : 2945 / 1000 = 2.945
    :
    : Then, we concatenates the figure "M" so many times as the integer
    : result from the previous division; and we get "MM" (2 times) which
    : means 2 thousands.
    :
    : Now, we make the same division but store only the modulus of such
    : operation, (the modulus is the remainder of a integer division) and
    : make it our new number to work with.
    :
    : 2945 % 1000 = 945
    :
    : Then, our new number is 945, we make the same operation on the first
    : step, but now we use 900 which is represented by "CM".
    :
    : 945 / 900 = 1.05
    :
    : Again, we repeat the step of concatenation of the figure in
    : question, so many times as the integer result from the previous
    : operation; and we get "CM" (1 time, is impossible to have something
    : different 1 or 0, but still important because we can get 0). We add
    : the first concatenation which gave us "MM", so we get "MMCM" which
    : means 2900.
    :
    : So, we repeat the modulus operation again with the corresponding
    : values "now in turn".
    :
    : 945 % 900 = 45
    :
    : Ok, now we repeat the previus operations, you had two examples by
    : now, so i will simplify ...
    :
    : 45 / 500 = 0 (The real thing is 0.09, but the 0 is what matters)
    :
    : This step gave us nothing to add, but still has to get the remainder,
    :
    : 45 % 500 = 45
    :
    : Hey, like you saw, nothing happended, because 500 is not inside 45
    : (it's not divisible). We make the same steps with 400, 100, 90, 50
    : ... and those gave us nothing too. Until 40 ... we make the same
    : operations again ...
    :
    : 45 / 40 = 1.125
    : 45 % 40 = 5
    :
    : Now we got 1 in the division, so we concatenates "XL" which means 40
    : so many times as the integer division (1 time). And with the
    : previous result of "MMCM" we got earlier, we got "MMCMXL", now we
    : have 2940.
    :
    : We made the same steps with 10, 9 and got nothing.
    : At 5, we have to do the same procedure and we add "V".
    : Now we have "MMCMXLV" which means 2945.
    :
    : Still have to do it with 4 and 1, because the number could have been
    : 2944 or 2947, but with the same procedure we will get the correct
    : result.
    :
    : Now we have the result and display on the screen.
    :
    : MMCMXLV = 2945.
    :
    : the most highest value on roman is m (small m).
    : it means a billion or something like that, in this example I will
    : not use it. (Even when is the same procedure)
    :
    : [red]Good luck![/red]
    : [blue]Hackman[/blue]



    :hey, thank you so much for your help... yes, i am starting from a scratch and i really cant figure out what to do and where to start. although we've done the same thing before with decimal to binary coversion. we also did the same procedure with the denomination or breakdown of an amount entered from the highest to the lowest denomination of our money. fortunately, i was the first one to get the correct procedure. but with this one, i dont know what happened to me and i seem to get confused. and my instructor is insisting on not using the concat or any other procedure just the if-then-else conditional statement. and i just thought, "oh gooodness.. it might take me forever." anyway, i really appreciate your help, sir. i promise not to use what you just shared to me to cheat.. i will study all those procedure that you gave me... thank you so much.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories