Arabic Numbers to Roman Numerals


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Arabic Numbers to Roman Numerals

  1. #1
    Join Date
    Jul 2007
    Posts
    12

    Arabic Numbers to Roman Numerals


    Im new to JAVA. I have difficulty of having two programming languages( JAVA AND C++ ) at the same time, Im fully loaded of 32.5 units at school, I like to know more that's why i'm asking help. My point is to compare my work with, although i made my own but its too long and that would be a minus points for me. I have another problem in java, the problem says that "Make a program that conversts arabic numbers to roman numerals", criteria: make a class called RomanNumerals and an object called RomanConverter and use constructor. This problem is easy for me but it does not meet the criteria and doesn't use use a constructor, I used Switch Case. Would you help me with this. And also I would like to ask something about the buffered reader, I have difficulty in outputting an integer, I dont know where to put the Integer.parseInt(), can you give me an example of this. And a little idea about the criterias that i have mentioned. Pls. post some sample codes for me.

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    well, you need to construct an instance named RomanConverter of your RomanNumerals class. How are you going to construct that instance? (Are there data fields you need to initialize? Even if it is just a "int data" field that you initialize as zero)

    RomanNumerals()
    {
    data = 0;
    }

    this isn't about the methods you use in your RomanNumerals class - perhaps providing a

    String convert( int number)

    method in your RomanNumerals class, and when you invoke the method in your romanConverter instance

    int test = 454;
    String output;
    output = romanConverter.convert(test);
    System.out.println(output);

    in order to get the roman numeral representation to the arabic number you supplied. It is about thinking of dispatching any need you have of producing a representation of the value in RomanNumerals to an instance of that class - a "separation of concerns" - rather than writing a "one overall blob of a program".

Similar Threads

  1. decimal to roman numerals conversion
    By jhaycee7042 in forum VB Classic
    Replies: 2
    Last Post: 02-27-2007, 12:09 AM
  2. Please Help-Roman Numerals Program with classes
    By sailinghunter in forum C++
    Replies: 3
    Last Post: 08-09-2006, 06:14 PM
  3. Replies: 8
    Last Post: 06-19-2006, 06:05 AM
  4. Replies: 1
    Last Post: 05-31-2006, 03:14 AM
  5. ID Numbers are out of sequence
    By sensei in forum VB Classic
    Replies: 1
    Last Post: 05-18-2006, 02:25 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center