-
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.
-
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
-
By jhaycee7042 in forum VB Classic
Replies: 2
Last Post: 02-26-2007, 11:09 PM
-
By sailinghunter in forum C++
Replies: 3
Last Post: 08-09-2006, 05:14 PM
-
Replies: 8
Last Post: 06-19-2006, 05:05 AM
-
By kanakatam in forum Java
Replies: 1
Last Post: 05-31-2006, 02:14 AM
-
By sensei in forum VB Classic
Replies: 1
Last Post: 05-18-2006, 01: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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks