View Single Post
  #1 (permalink)  
Old April 21st, 2016, 03:50 PM
Maximilian Maximilian is offline
Registered User
Points: 16, Level: 1
Points: 16, Level: 1 Points: 16, Level: 1 Points: 16, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2016
Location: Buffalo, NY
Posts: 4
Thanks: 4
Thanked 0 Times in 0 Posts
Default Converting Roman numerals

Hello everybody,

I have started learning VB and am reading Stephens' Visual Basic Programming 24-Hour Trainer, which I find very systematic and helpful, but I cannot wait until I finish the book to write programs, so I am dabbling in some simple challenges while I read. I want to write a program that would convert Roman numerals to Arabic ones. I am sure this code already exists on the Web, but I would like to write my own as an exercise.

I think the Roman numeral would be a String input, which we would have to convert to an array of letters, then parse the array, pull out the special combinations IV, IX, XL, XC, CD and CM and convert them to their respective integers, then convert the remaining letters to integers, and add all the integers together to get the answer.

My question is, what would be the best command syntax to isolate the special combinations and to loop through the array to convert the letters into integers? I would be very grateful for any pointers. Thank you very much for your help.

All the best,
Maximilian
Reply With Quote