College program assignment need help please!!!!!

I have to write a java class called Factor Number that gets a whole number from the user and determines its divisors. It should return the results in a dialog box with a message like: The factors of 25 are 1,5,25.
My problem is that I can do the simple items but I don't know how to set up the math or loops to get my program to check the factors for me. Can anyone help me with this it would be awsome. what loops to use and how to get it to do factors I have looked all over the web for sample code with no luck this is my last shot for someone out there to help me get this thing started. thanks if you respond!!!!!!

try this:
import java.io.*;
class FactorNumber
     public static void main(String[] args)
          int base = 0;
          try{
          System.out.println("Enter the base : \t " );               
          BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));
          base = Integer.parseInt(br1.readLine());          
          for(int x=1;x<=base; x++ ){
          if(base%x==0){System.out.print(x+" ");}
          }catch (IOException e){System.out.println("The error" + e);}
}

Similar Messages

Maybe you are looking for

  • Embedded youtube video not showing up in IE

    Ok, I dont know whats wrong here. Im redesigning a site and Im trying to embed a youtube video. It works fine in ff and in chrome but nothing appears on my page at all in IE. Ive looked on every forum i could for the answer but no one seems to really

  • Trying to change the text of the command button.

    Hi., Am using jdeveloper 11.1.1.6., I have dragged and dropped a command button in my jsff page. When there is no record in my VO which dragged and dropped as a af:form the button will act as a create insert so that the text of the button should also

  • HT5191 i can't update iTunes 10.6.1

    i can't update iTunes. i got this message: The file "iTunesXPatch.pkg" couldn't be found on the server "swcdn.apple.com". what should i do?

  • GR/IV Gross or Net Postings

    Hi Experts, Where is the configuration setting to control Goods Receipt & Invoice Receipt to post as 'Gross' or 'Net'. Thanks in Advance

  • How to add Currency field with dropdown on screen layout (module pool)

    I need to add a field called <b>Currency( field label )</b> with <b>dropdown (like SKB1-WAERS). </b> The <b>field label</b> and <b>input output field </b> should default as being hidden and sould be visible only when other field value ( on the same s