Results 1 to 6 of 6
- 09-21-2011, 11:25 PM #1
Member
- Join Date
- Sep 2011
- Posts
- 5
- Rep Power
- 0
- 09-21-2011, 11:58 PM #2
Re: String to Int: Roman Numeral Class
Can you give an example?having trouble setting letters to integers
By letters do you mean Strings? See the Integer class. It has a method to convert a String to an integer.
- 09-22-2011, 01:40 AM #3
Member
- Join Date
- Sep 2011
- Posts
- 5
- Rep Power
- 0
Re: String to Int: Roman Numeral Class
Uhhh well I was going to have the user input a value through Scanner and set it as
String word = reader.nextLine();
and then set X to be 10, I to be 1, etc, and then calculate a value. I'm a bit confused as to which function does that.
- 09-22-2011, 01:54 AM #4
Re: String to Int: Roman Numeral Class
Java does not have a method for Roman Numerals. You will have to write one.I'm a bit confused as to which function does that.
I don't know what classes you are allowed to use with this assignment. The Map class would be useful.
Or you might have to use a chain of if/else if statements to get the numeric value for a letter.Last edited by Norm; 09-22-2011 at 01:58 AM.
- 09-22-2011, 04:07 AM #5
Member
- Join Date
- Sep 2011
- Posts
- 5
- Rep Power
- 0
-
Re: String to Int: Roman Numeral Class
Similar Threads
-
Convert year to roman numeral.
By jdm113497 in forum New To JavaReplies: 2Last Post: 03-31-2011, 09:15 PM -
convert roman numeral to number
By the beginner in forum New To JavaReplies: 3Last Post: 01-27-2011, 06:49 AM -
How to identify a roman numeral
By dunworry in forum New To JavaReplies: 13Last Post: 12-19-2010, 08:13 AM -
Arabic to roman and Roman to Arabic Converter Program
By tabako in forum New To JavaReplies: 11Last Post: 11-02-2010, 05:46 PM -
Roman numeral to Decimal
By hector100 in forum Advanced JavaReplies: 3Last Post: 04-04-2009, 07:48 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks