Results 1 to 4 of 4
  1. #1
    the beginner is offline Member
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default convert roman numeral to number

    i just want to know if there is someone who is interested to help me out to convert roman numeral using CASE, STRING FORMAT :( i don't even know how to get started kinda confused :( i just hope someone will help me out...

    thankz

    -angie-

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,784
    Rep Power
    7

    Default

    Quote Originally Posted by the beginner View Post
    i don't even know how to get started
    I find that hard to believe. You cannot even write a simple program like Helloworld? If so then you either need some intensive revision or drop the course. If you do know how to do HelloWorld then you do know how to start.

    Take baby steps. Write a class that is nothing more than hae the correct name and prints out a simple message. Then move onto printing something like the decimal equivalent of each Roman numeral. Then advance to if user enters 5 it prints out V etc etc.

  3. #3
    the beginner is offline Member
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    i didn't exactly mean that i didn't really know how to get started. I was just confused. i got something in mind but when i think about something else thats where i messed up.. lol :) thanks for the comment anyways :) it's ugly but it's ok :)

  4. #4
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Do the parts you know how to do first. Choose a name for your class. You probably need just one instance variable: an int to store the number you're going to convert. You should have a void setArabic(int number), a void setRoman(String numeral), an int getArabic(), and a String getRoman(). For starters, keep the methods simple. Your getArabic() and setArabic() methods just save and return the number. For starters, the number will be either a 1 or a 5 -- nothing else. That should make getRoman() and setRoman() easy to implement. Write your main() method with all the Scanner and System.out.println() code, and get that much working properly.

    Then you just have to do the real setRoman() and getRoman() methods, and you'll have a framework for testing them. Start small and improve them incrementally. Make them work just for 1-10 first, then get it working for 1-50, then 1-100 and so on.

    -Gary-

Similar Threads

  1. Convert the number to Roman numerals
    By ŖΫ ỏ Ңόρę in forum New To Java
    Replies: 9
    Last Post: 11-29-2012, 10:44 PM
  2. How to identify a roman numeral
    By dunworry in forum New To Java
    Replies: 13
    Last Post: 12-19-2010, 08:13 AM
  3. Convert roman numerals
    By matzahboy in forum New To Java
    Replies: 4
    Last Post: 02-21-2010, 10:06 PM
  4. Roman numeral to Decimal
    By hector100 in forum Advanced Java
    Replies: 3
    Last Post: 04-04-2009, 07:48 PM
  5. Convert roman numerals to integers
    By Felissa in forum Advanced Java
    Replies: 2
    Last Post: 07-01-2007, 11:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •