Techware Labs Header

Forums have moved

See this announcement for more details, or just go directly there.

Prev Previous Post   Next Post Next
  #1  
Old 04-22-2004, 08:45 AM
Hammmy
 
Posts: n/a
Default easy roman numerals

could someone make this program actually do roman numerals.

Dim a As Integer
Dim b As Integer
Dim Digit As Integer
Dim RomanNumber As String
Dim RomanDigit As String
Roman = InputBox("Type in number", "Numerals", "X")
a = Len(Roman)
RomanNumber = Roman
RomanNumber = UCase(RomanNumber)

For b = a To 1 Step -1
RomanDigit = Mid$(RomanNumber, b, 1)
Select Case RomanDigit
Case "L"
Digit = 50
Case "C"
Digit = 100
Case "D"
Digit = 500
Case "M"
Digit = 1000
Case "X"
Digit = 10
Case "I"
Digit = 1
Case "V"
Digit = 5
Case Else
MsgBox ("Invalid Character")
End Select
firstnumeral = Digit
secondnumeral = secondnumeral + firstnumeral
If secondnumeral > firstnumeral Then
secondnumeral = secondnumeral - First
End If
Next
MsgBox "Numeral " & secondnumeral
Reply With Quote
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:52 PM. Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum style by ForumMonkeys.