I would like to take the Roman Numeral value stored in the object and convert it back to integer, long, float, and double values. I really don’t know where to start, other than creating the appropriate methods. Can anyone offer some advice?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your question seems to be how to convert a roman numeral to integer. In that case all you need is one function to parse the string from left to right and add the result together while looking for smaller numbers that should be subtracted.
Once you have the integer you can cast it to the other numeric types.