I need to create a class to use with another program that will take regular numbers and convert them to roman numerals. So far I have this:
public class Roman { public Roman(String r){ char c = r.charAt(0); int value; if(c=='I') value=1; else if(c=='V') value=5; else if(c=='X') value=10; else if(c=='L') value=50; else if(c=='C') value=100; else if(c=='D') value=500; else if(c=='M') value=1000; } public void printRoman(){ System.out.println(); } public void printInt(){ System.out.println(); } }
I know i need a loop for the if else if part, but I'm not too sure on what that loop is. Also, i need code after the printRoman part, but I don't know that either. If someone could point me in the right direction, that'd be great.