This is a question for Schillj HELP!!!!

Last week you helped me with this code
unfortunately I am so novice that I cant get it to work anywhere I understand it completely I just dont know where to put it in java code. Unfortutnately the logic is the easy part for me right now. I have researched everything that I dont understand in the code and understand it now. but the code and syntax make very little sense at this point.
I have a program that allows to input a number and then hit a calculate button that would obviously run the number through this code but how do I implement this or place insert it into a program. HELP!!!!
final static int MAXVALUES = 7;// 1, 5, 10, 50, 100, 500, 1000// is there a 5000 symbol and beyond?
final static String[] Symbols ={"I", "V", "X", "L", "C", "D", "M"}; 
String toRoman(int input) 
  if(input < 0)    
  throw new IllegalArgumentException("Error! value less  than 0");  
if(input > 3999)     
throw new IllegalArgumentException("Error! value exceeded 3999");   
int[] values = new int[MAXVALUES];  
int scale = 1;  
int mult = 5;  
for(int loop = 0; loop < values.length; loop++)  
   values[loop] = ( input % (scale * mult)) / scale;       scale *= mult;    
mult = (mult == 5 ? 2 : 5);    }  
// values are now set as per my last post   
// the fives, fifties, five hundreds values can only be 0 or 1   
StringBuffer buf = new StringBuffer("");  
// now evaluate string   
for(int loop = 0; loop < values.length; loop++)  
   switch(values[loop])    
    case 4:       
  // this can only happen on a 1s, 10s, 100s, etc      
   if(loop != values.length-1)      
if(values[loop+1] == 1)          
     // special case, this does "IX", "XC", etc                  buf.append(Symbols[loop+2]).append(Symbols[loop]);          
   // now increment loop as we have taken care of the next symbol             
loop++;          
   else          
// this does "IV", "XL", etc.           
  buf.append(Symbols[loop+1]).append(Symbols[loop]);          
break;      
case 3:
// this does "III", "XXX", etc        
buf.append(Symbols[loop]);       
case 2: // this does "II", "XX", etc        
buf.append(Symbols[loop]);      
case 1: // this does "I", "X", etc        
buf.append(Symbols[loop]);         
break;       
case 0:       
  break;      }    }
    return buf.reverse().toString();  }

I am sorry I am really not trying to scam anyone. here is my code.
package newroman;
* Title:        newRoman
* Description:
* Copyright:    Copyright (c) 2001
* Company:
* @author Matt Wilson
* @version 1.0
public class NewRoman {
   private int vNumber;
   public NewRoman()
   public NewRoman ( String roman, int number)
   this.setNumber(number);
   public int getNumber()
      return vNumber;
   public void setNumber ( int number )
      if ( number <= 0 )
      vNumber = number;
   public String getRoman()
      String strNumber = new String( String.valueOf(this.getNumber()));
      String romNum = new String();
      //find blank position in number
      int blankPos = strNumber.indexOf(" ");
      // get the number out of the string
      int stdNum = Integer.parseInt( strNumber.substring(0,blankPos));
      // determine thousands
      if ( stdNum >= 1000)
         romNum = threeDigits (stdNum / 1000);
      // determine hundreds, tens and ones
      romNum = romNum + threeDigits ( stdNum % 1000);
      return romNum;
   private String threeDigits ( int roman )
       String onesVal[] = {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII",
                          "IX", "X"};
       String tensVal[] = {"", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"};
       String hunVal[] = {"C", "CC", "CCC", "CCCC", "D", "DC", "DCC", "DCCC", "CM"};
       String thouVal[] = {"M", "MM", "MMM", "MMMM"};
       int thouAmount = roman / 1000;
       int rem = roman % 1000;
       String romNum = new String();
       if (thouAmount > 0 )
          romNum = thouVal[thouAmount];
       int hunAmount = roman / 100;
       if (hunAmount > 0);
          romNum = hunVal[hunAmount];
       int tensAmount = rem / 10;
       if ( rem < 20 )
          romNum = romNum + onesVal[tensAmount];
       else
         // int tensAmount = rem / 10;
          int onesAmount = rem % 10;
          romNum = romNum + tensVal[tensAmount] + onesVal[onesAmount];
      return romNum;
}If anyone can give me any pointers on how to make it better especially with jbuilder. I just want to learn it is my only goal not to scam anyone anywhere.
thanks!

Similar Messages

  • When I try to save a document a message comes up saying "Couldn't auto-save document." How can I fix this? Thank you for your help!

    When I try to save a document a message comes up saying "Couldn't auto-save document." How can I fix this? Thank you for your help! - Chip

    This is a mean one. I don't have time to try and find the cause, but at least some answers to your questions, to hopefully shed some more light on this.
    Where was the original destination? iCloud folder.
    On another drive? Tried to Save as... to Hard Drive (also changing name of file), always get the same non-descript short Error "Couldn't auto-save document." (slides down from top with a yellow warning triangle). Status to the right of document name is "Not Saved".
    Another Server? No access at this time.
    I also tried File, Revert to, Browse all versions, to check what I'd be losing. Saw I wasn't losing much and selected the last version and pressed Restore - same error. In the end I just quit Pages and re-opened. The document opened with the last few edits missing (but with the status "Edited" next to the name). I re-edited and could save. Good old habit of saving often.

  • Two separate iPhones got merged into one iTunes account. How to separate them. We are sharing all of each other's contacts at this time. Thanks for your help.

    Two separate iPhones got merged into one iTunes account. How can I separate them in iTunes???????. We are sharing all of each other's contacts at this time. Thanks for your help.

    The reason you are receiving each other's text messages is because you are both using the same Apple ID for iMessage.  To prevent this you need to use different IDs.  (Note: you can still share the same ID for iTunes.)  On one of the phones, go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign back in with a separate ID.
    To migrate your 3GS to a new iCloud account, start by saving any photo stream photos that you want to keep on the phone to your camera roll.  To do this, open the my photo stream album, tap Edit, tap the photos, tap Share, tap Save to Camera Roll.  Next, if you have any notes that you are syncing with iCloud that you want to keep, you'll need to email these to yourself so they can be recreated after moving to the new account.
    Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from this phone, not from iCloud.  The phone that will be keeping the account will not be effected by this.)  When prompted about what to do with the iCloud data, choose Keep On My iPhone.  Next, sign back in with a different Apple ID to create the new account, turn iCloud data syncing preferences and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.
    Finally, if you have merged data in the two accounts that you want to separate you will have to go to icloud.com from your computer, sign into each iCloud account separately and manually delete the data you don't want from each account.

  • I have a problem that I try to turn on the iPad 2, but he was just lighting up, but nothing is displayed. I do not know what happened, but yesterday did not do this. Thank you for your help.

    I have a problem that I try to turn on the iPad 2, but he was just lighting up, but nothing is displayed. I do not know what happened, but yesterday did not do this. Thank you for your help.

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • TS1424 I recently took out a one month subscription on my Ipad to Euro Sport. This subscription will renew automatically at he end of the month. How do I cancel this subscription? Thanks for any help

    I recently took out a one month subscription on my Ipad to Euro Sport. This subscription will renew automatically at he end of the month. How do I cancel this subscription? Thanks for any help

    I recently took out a one month subscription on my Ipad to Euro Sport. This subscription will renew automatically at he end of the month. How do I cancel this subscription? Thanks for any help

  • HT201303 i forgot my security questions for itunes help me

    hi how are you i make my id befor 6 month or 7 i don't remember and i forgot my security questions for itunes and i have the new pass and old and i'm ready for any questions to belive me and my email [email protected] and i have know iphone 5 and ipad 2 and mac air and i change my iphone every month i love apple aloooot please help meeeee

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (99646)

  • I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    Can you open the Preview program without loading a file, like by itself?
    If it doesn't load then I suspect a corrupt Preview preference file.
    Deleting the System Preference or other .plist file
    Can you open other files with Preview, like jpg's and images?
    How about other PDFs? or is it just that one you have downloaded?
    Run through this list of fixes
    Step by Step to fix your Mac

  • Sign in question for LINKSYS help

    When I type "admin" in the username spot it then asks me for a password. I have NO idea what my password is. How can I still access all that I need to? Is there a way to reset it?
    Thanks!
    Sunshinelover

    Hi,
    We have had the same ADSL Router for a year now and we have not had this problem before. I was on the phone to LINKSYS support for 3 hours last night and they could figure this out.
    PROBLEM: For some reason we can see the airport bars or if we connect via Ethernet we see it as a connection on our laptops but it doesn't allow us to connect to the internet.
    The little green light on the router which sits bellow where it says internet isn't green and flashing anymore -  there is no light.
    I called our ISP and they said that our modem had to be reconfigured by LYKSYS and gave me a really long list of letters and numbers. But LYNSIS didn't know what they meant???
    Does anyone know what I am talking about????? PLEASE!!!  

  • More clear question  for slideshow help - Kin?

    Hi Kin,
    You have been very helpful in getting me this far - I know
    this last detail would be a very easy thing for you to do.
    I tried to get it to work for the dssmTitle by adding another
    dssmTitle.addObserver
    http://www.tsgraphics.net/slideshow_test/
    The mouseover function is fine the way it is. It's how it
    behaves during the slideshow that is a little wierd - it just sits
    on the first story. It would be great if it switched to each story
    like the small nav at the bottom highlights to each corresponding
    nav to its story during the slideshow.
    I hope this is more clear.
    Thanks!
    TS

    Hi TS,
    So it sounds like you want to change the current row of
    dschapters and stop the slide show on mouesover, and then re-enable
    the slideshow on mouseout right?
    Try something like this:
    var gTimerID = 0;
    var gInterval = 3000;
    function StartSlideShow()
    StopSlideShow();
    gTimerID = setInterval(function(){
    dschapters.setCurrentRowNumber((dschapters.getCurrentRowNumber() +
    1) % dschapters.getRowCount()); }, gInterval);
    function StopSlideShow()
    if (gTimerID)
    clearInterval(gTimerID);
    gTimerID = 0;
    dschapters.addObserver(function(nt,n,d)
    if (nt == "onPostLoad")
    StartSlideShow();
    <div id="nav" spry:detailregion="dschapters"
    spry:repeatchildren="dschapters" spry:choose="choose">
    <div spry:when="{ds_RowID} == {ds_CurrentRowID}"
    id="nav2" class="currentChapter" spry:setrow="dschapters"
    spry:hover="hoverRow"><img src="{thPhoto}"
    onmouseover="StopSlideShow();
    dschapters.setCurrentRow('{ds_RowID}');"
    onmouseout="StartSlideShow();" /> </div>
    <div spry:default="default" id="nav2"
    spry:setrow="dschapters" spry:hover="hoverRow"><img
    src="{thPhoto}" onmouseover="StopSlideShow();
    dschapters.setCurrentRow('{ds_RowID}')"
    onmouseout="StartSlideShow();" /></div>
    </div>
    On a side note, if you are trying to bring your question to
    the top of the forum again, post a message in your original thread
    ... that is don't create a new thread each time ... that way the
    context of your questions is preserved for others to read. If you
    post new threads each time, folks have to search for your previous
    posts/threads to get context.
    Thanks,
    --== Kin ==--

  • This is a question for all my adobe applications in the CS6 suite. How do i manually update them? I have not gotten any updates in about 6 months and they are running really slow. I really think this is the issue. How can i do this?

    I am a full sail university film student and I need all my adobe applications running strong. Everything is running slow and sluggish. I think this might be the issue. Does anyone know how to manually update the adobe Cs6?

    What does your computer's sluggishness have to do with any potentially missing updates? That's pretty much nonsense. The last AE update was the 11.0.4 one from November, anyway, and it's only relevant for Mac people more or less. Whatever issues you have have nothing to do with that but rather poor system configuration and maintenance - fragmented cache disks, disks almost full with temp files, too many other processes/ programs running and gobbling up resources, aggressive external tools like virus scanners blocking access to files and functions and so on. Really, you are completely looking in the wrong place. Bring your computer up to speed and AE will run a lot better.
    Mylenium

  • I purchased my iMac 5 years ago. It uses OS X Version 10.5.8.  I would like to upgrade to Maverick but it won't let. How do i accomplish this.  Thank you for your help!

    I purchased my iMac 5 years.  I have never upgraded the operating system from the original version 10.5.8 
    How do I upgrade to Maverick.  Thanks for any input.

    The first step in Upgrading... is to Snow Leopard = OS X 10.6.x
    It is Not available as a download... It is a Paid Upgrade.
    Do this first...
    Check that your Mac meets the System Requirements for Snow Leopard...
    Snow Leopard Tech Specs  >  http://support.apple.com/kb/SP575
    If so... Purchase a Snow Leopard Install Disc...
    http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
    After the Successful Install, run Software Update to get the latest updates for Snow Leopard and iTunes.
    Be sure to make a Backup of your Current System Before Upgrading...

  • 2 Questions for Layout Help (new to DW)

    Hey All,
    I'm semi- new to dreamweaver, and although I know the basics, I'm having trouble creating the layout I had planned.
    Currently I'm working off a 2 column + header and footer template.
    I'm trying to make it so that the header, footer and sidebar are fixed, snapped to their respective sides of the browser no matter how the browser is resized. I would also like to make the main content offer a scroll bar if it exceeds the room between the header and footer. (so that the "room" look isn't ever changed. ie, the floor and ceiling, and dresser stay visable.)
    It looks pretty good here.
    figure A.)
    Though here when I resize the browser the dresser comes off of the floor, and I don't know why.
    Figure B.)
    So, most important questions are.
    1.) What kind of positioning method should I be using to keep the dresser snapped to the floor which is snapped to the bottom of the browser?
    2.) What should I change in the #mainContent CSS to offer a scroll bar if the content exceeds the room available?
    Bonus Questions if anyone feels extra awesome today.
    1.) I have 3 div boxes in the header, Roof_right, Roof_left are both absolutely positioned. The middle Div box has a background of the logo. If I resize the browser enough, the logo actually gets hidden behind the absolutely positioned pieces, which isn't good. How can I fix this?
    2.) I would like to stick the dresser about 50px down into the footer if possible, instead of sitting directly on top of it. Is this possible?
    Thank you
    B

    It comes down to how you slice your layout.
    http://alt-web.com/DEMOS/Image-slices-in-a-CSS-based-layout.shtml
    I would avoid APdivs if at all possible as they take content out of the normal flow and can trip you up if you're not careful.  I would start with the following basic CSS layout.
    CSS:
    #Container {width: value in pixels; margin:0 auto; /**centers on screen**/; background: url (page-background.jpg) repeat-y;}
    #headerWrapper {width: value in pixels; min-height: value in pixels or ems; background: url (roof.jpg) no-repeat;}
    #header-left {float:left; width: 25%;}
    #header-right {float:right; width: 25%;}
    #mainContent {margin-left: value in pixels; height: value in pixels; overflow: scroll; /**scrolling division**/}
    #SideBar {float:left; width: value in pixels; background: url (middle-dresser.jpg) repeat-y}
    #footer {background: #FFF url {dresser-feet.jpg) top left no-repeat; min-height: value in pixels; text-align:center}
    2-column, fixed width, centered
    http://alt-web.com/TEMPLATES/2-col-fixed-layout.shtml
    Floats & Margins demo - 3-boxes
    http://alt-web.com/DEMOS/3-CSS-boxes.shtml
    Good luck,
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • Question for apple help

    help me i need a f&*&&*(((ken email or phone number for sume F&()&((&^&(ken help
    with i tunes have asked for help here 3 times get no help
    help me

    If the iPhone has Activation Lock - that is, it's asking for the previous owner's Apple ID and password to activate the device - then you will need that information, or you'll need to get the previous owner to remove the device from his/her iCloud account:
    http://support.apple.com/kb/PH2702
    If you can't reach the previous owner or he/she is unwilling to cooperate, then the device is unusable by you. Return the iPhone for a refund if you can.
    Note also that the Japanese cell carriers will not unlock iPhones for use with carriers in other countries, so you probably cannot use the iPhone in Vietnam even if you can get Activation Lock cleared.
    Please be aware that you are not communicating with Apple when you post in these forums. These are user-to-user support forums, so in almost all cases the only people who will reply to your posts are, like me, your fellow users.
    Regards.

  • This is a question for Someone with a UK 80gb video ipod, NOT A CLASSIC

    Can someone please tell me if this works
    Open itunes, connect pod
    Select all in ipod (not itunes library , while connected)
    Get info
    Slide the vol slider all the way to 100
    Wait a few moments for the magic to happen
    Then is the output louder, like it makes it on my 60gb ipod
    Not just full volume half way as some suggest, but LOUDER
    plugging into a recording device and watching the meter go up more is proof that my ears are not lying
    My 2nd and 5th gen ipods do this but it has no effect on a classic
    I would say around 60gb of my music is barely audible (Ripped vinyls so they are not as loud as CDs)
    which is why Im after a 80gb 5.5 gen but dont fancy wasting more money after the fiasco called a classic ipod
    Many thanks

    cypherism wrote:
    I would say around 60gb of my music is barely audible (Ripped vinyls so they are not as loud as CDs)
    Why aren't they?
    I've watched your previous threads on this subject with the same trepidation as Meg St. Clair, deggie, Jeff Bryan and Zevoneer (all of whom have a lot of knowledge and earn my respect for it), but I have hesitated to respond for obvious reasons. Until now.
    You mention ripped vinyl being quieter than CDs. Perhaps you should get the level right on the ripped vinyl before importing it into iTunes. Then it would be (almost) the same as CDs.
    I use Audacity to rip vinyl to .mp3 for importing to iTunes. Whatever programme you use (if it's any good) should have similar feature to the one I'm about to describe. Once recorded into Audacity and trimmed to length, select all (of the file) and click on Effect/Amplify . A dialogue box comes up which tells you how much amplification will be applied and the new peak amplitude (dB). You should not go above the 0dB mark, nor should you "allow clipping" because you will introduce distortion and/or "clip off" the loudest sounds which will sound dreadful. (I actually amplify to a new peak of -0.3dB, that's my safety margin.)
    I mentioned before that the file would now be almost the same as a CD. A CD has a wider dynamic range than vinyl (the difference between the softest and loudest sounds) and many recent CDs also have far more bass than vinyl, which was limited in this respect due to the technology available at the time. Consequently, your ripped vinyl-to-mp3 will probably never be as "punchy" as CD, but at least there will be less difference if the dB level is similar. You could also boost the bass in Audacity - before amplifying - but be very cautious because it's a crude adjustment and if you over-do it, the result will be very tiring when you listen to the song more than once! I speak from experience!
    If you use the "boost" feature in iTunes *and it actually does something", it will probably introduce distortion, especially if you simply "blanket boost" all your mp3s by the same amount. It's a very crude method of achieving very little. it should be used selectively and with caution.
    By the way, I have a 5th gen late model UK iPod and a 160GB Classic! Whether or not it, or they both have a volume cap - live with it!

  • TS3899 Getting a "background picture of angry birds" in back of my e mail messages...any ideas how to get rid of this?  Thanks for your help

    All of a sudden I am getting a background picture of angry birds in my e mail.  I can view the mail but it is annoying.
    I have cleard the history an still it appears.   Any ideas on how to get rid of this garbage?  Thanks for your help.

    Bettina:
    Do you see the color in Designer, or only Acrobat. If it's only in Acrobat, try changing the menu item Forms >> Highlight Fields. This toggles entry field highlights on and off.
    Mark
    You can shut off or change the highlight with this
    app.runtimeHighlightColor = color.red;
    if (app.runtimeHighlight)
    app.runtimeHighlight = false;

Maybe you are looking for

  • Front End Patch 11

    Hi, We are on BI 7.0 SP 10. I just applied the FEP 11 on my system and now when i run query from Analyzer, the screen freezes ( selection box does not popup as well for queries with selection ). But if i try to create a workbook in design modeby atta

  • Last time, I've set password for if my iPod is lost, and now I forgot it

    Hi. Last time, I've set password for "Find my iPhone" if my iPod is lost and now I forgot the password for it. Is there any ways that you can help me to unlock it by today?

  • Keynote will not open in Powerpoint for Mac 2011

    I followed all the instructions for saving the Keynote presentation for Powerpoint. But, when Powerpoint for Mac 2011 tries to open it, it will not open and gives me an error message indicating it needs repair; I click repair, it says there is someth

  • Is it possible to change the Costing Lot size for preference calculation?

    Hi Gurus, Is it possible to change the costing lot size for the preference calculation? Reason for my question is: We have all prices on price unit 100 and we want to use also the price unit 100 for preference calcalation. But the preference calculat

  • FCPX will not open after move to a new Mac'

    I've just invested in a "new" 2010 MacPro and transferred everything from my 27" iMac, ( same year vintage ), to the MacPro using Carbon Copy Cloner to a new 2tb Hard Drive, installed that drive into the MacPro as it's Start Up drive and everything o