0

Anyone can help me how to convert real number to Romawi number and input 1-5000??? Thanks

Java

5th Feb 2020, 1:23 PM
Muhamad Zen Fikri
Muhamad Zen Fikri - avatar
9 Respostas
+ 3
I would store theese letters: I (1) V (5) X (10) L (50) C (100) D (500) M (1000) I would store also store these special roman numbers: IV (4) IX (9) XL (40) XC (90) CD (400) CM (900) they are used to avoid 4 equal letters: instead of IIII use IV Start with the largest roman number and subtract it from your decimal number as often as possible. For example 289: 289 - 100 = 189 189 - 100 = 89 -> subtract 100 two times -> CC 89 - 50 = 39 ->CCL 39 - 10 = 29 29 - 10 = 19 19 - 10 = 9 -> CCLXXX 9 = IX -> CCLXXXIX 512: 512 - 500 = 12 -> D 12 - 10 = 2 ->DX 2 = II -> DXII Hope this helps.
5th Feb 2020, 4:24 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Thanks
5th Feb 2020, 5:00 PM
Muhamad Zen Fikri
Muhamad Zen Fikri - avatar
+ 1
You mean roman I, II, III, IV... numbers?
5th Feb 2020, 1:37 PM
Seb TheS
Seb TheS - avatar
+ 1
Thanks
5th Feb 2020, 1:41 PM
Muhamad Zen Fikri
Muhamad Zen Fikri - avatar
0
Romawi?
5th Feb 2020, 1:36 PM
Seb TheS
Seb TheS - avatar
0
Like I II III IV V ... X
5th Feb 2020, 1:38 PM
Muhamad Zen Fikri
Muhamad Zen Fikri - avatar
0
Ok, yes
5th Feb 2020, 1:39 PM
Seb TheS
Seb TheS - avatar
0
Example If input 1 = I 2 = II ... 9 = IX like that
5th Feb 2020, 1:39 PM
Muhamad Zen Fikri
Muhamad Zen Fikri - avatar
0
Yes
5th Feb 2020, 1:40 PM
Seb TheS
Seb TheS - avatar