I need help with program problem

I need help with a problem, I dont understand with it trying to tell me to do.
Create a number NN which is N placed next to it.Example, if the number N is 263 then NN is 263263. If N is 7, NN is 007007. Then divide NN by 7.11 and 13 This is what I have generated below.

public class Trial
{
public static void main(String[] args) {
int n = (int)Math.floor(Math.random()*1000+1);
int n = 263
int nn = 263263
System.out.println(+n,nn/7/11/3);
}
}
waltbaby315Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

for_yanCommented:
Should be somthing like that:

public class Trial
{ 
public static void main(String[] args) { 
int n = (int)Math.floor(Math.random()*1000+1); 
 String nS = "" + n;
   while(nS.length()<3)nS = "0" +nS;
    int nn = Integer.parseInt(nS + nS);
    
        int ndiv7 = nn/7;
       int ndiv11 = nn/11;
       int ndiv13 = nn/13;
    
    System.out.println("ndiv7: " + ndiv7 + "  ndiv11 " + ndiv11 + " ndiv13 " + ndiv13);
    
//int n = 263
//int nn = 263263
//System.out.println(+n,nn/7/11/3); 
} 
}

Open in new window

for_yanCommented:

This is woking - mind that division is integer -
the decimal part is truncated


public class Trial
{
public static void main(String[] args) {
    for(int j=0; j<10; j++){
int n = (int)Math.floor(Math.random()*1000+1);
 String nS = "" + n;
   while(nS.length()<3)nS = "0" +nS;
    int nn = Integer.parseInt(nS + nS);

        System.out.println("N: " + n + "  NN: " + nn);

        int ndiv7 = nn/7;
       int ndiv11 = nn/11;
       int ndiv13 = nn/13;

    System.out.println("ndiv7: " + ndiv7 + "  ndiv11 " + ndiv11 + " ndiv13 " + ndiv13);
              System.out.println("");
    }

//int n = 263
//int nn = 263263
//System.out.println(+n,nn/7/11/3);
}
} 

Open in new window



N: 708  NN: 708708
ndiv7: 101244  ndiv11 64428 ndiv13 54516

N: 227  NN: 227227
ndiv7: 32461  ndiv11 20657 ndiv13 17479

N: 691  NN: 691691
ndiv7: 98813  ndiv11 62881 ndiv13 53207

N: 149  NN: 149149
ndiv7: 21307  ndiv11 13559 ndiv13 11473

N: 771  NN: 771771
ndiv7: 110253  ndiv11 70161 ndiv13 59367

N: 7  NN: 7007
ndiv7: 1001  ndiv11 637 ndiv13 539

N: 806  NN: 806806
ndiv7: 115258  ndiv11 73346 ndiv13 62062

N: 855  NN: 855855
ndiv7: 122265  ndiv11 77805 ndiv13 65835

N: 252  NN: 252252
ndiv7: 36036  ndiv11 22932 ndiv13 19404

N: 116  NN: 116116
ndiv7: 16588  ndiv11 10556 ndiv13 8932


Process finished with exit code 0

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
for_yanCommented:
I know they should be divisible by 11.
I'm not sure about 7 and 13.
If they are then fine.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.