//***************************************************
// phoneNumber.java Author: Jayson
//***************************************************
import java.util.Random;
public class phoneNumber
{
//--------------------------------------------------
// create a random phone number like xxx-xxx-xxxx
// first three number can not be 8 or 9
// and the mid three number should less than 655
//-------------------------------------------------
public static void main(String[] args)
{
int number;
String result="";
Random gennerator = new Random();
number = gennerator.nextInt(8);
result += number;
number = gennerator.nextInt(8);
result += number;
number = gennerator.nextInt(8);
result += number;
result += "-";
number = gennerator.nextInt(656);
if(number<100)
if(number<10)
result += "00" + number;
else
result += "0" + number;
else
result += number;
result += "-";
number = gennerator.nextInt(10000);
if(number<1000)
if(number<100)
if(number<10)
result += "000" + number;
else
result += "00" + number;
else
result += "0" + number;
else
result += number;
System.out.println(result);
}
}