//Osman Erdi Balcoğlu 2k935016
import java.util.Random;
public class odev2 {
/**
*
*/
public static void main(String[] args) {
Random rnd = new Random();
System.out.println(“Welcome , Generating Phone Number”);
for (int i = 0; i < 1 ; i++) {
int addn = rnd.nextInt(10);
int firstn = rnd.nextInt(6)+2;
int secn = rnd.nextInt(100);
int thirdn = rnd.nextInt(643)+100;
int forthn = rnd.nextInt(100);
int sixn = rnd.nextInt(100);
System.out.print(firstn);
if (secn < 10 )
System.out.print( “0” + secn);
else
System.out.print(secn);
System.out.print(” ” + thirdn );
if (forthn < 10 )
System.out.print( ” 0” + forthn);
else
System.out.print( ” ” + forthn);
if (sixn < 10 )
System.out.print( ” 0” + sixn );
else
System.out.print( ” ” + sixn);
}
}
}
http://mkonar.selfip.com/come207/HW/ch03/excercise/PhoneNumberGenerator.html
Design by Simon Fletcher. Tumblr kaynaklı.
© Copyright 2010