public class
Student
{
public
String lastName;
public
String firstName;
public int grade;
public
String school;
public Student()
{
String[]
lastNames = {"Smith", "Do", "Bardot", "Lu", "Green", "Lowe", "Bacon", "Zoom", "Gravy", "TwoShoes", "Monroe", "Hope", "West", "Lopez", "Gray"};
lastName = lastNames[(int)(Math.random() *
lastNames.length)];
String[]
firstNames = {"Jimmy", "June", "Abbott", "Luna", "Harry", "Moon", "Lea", "Kayla", "Aryan", "Grace", "Drake", "Kiana", "Burt", "Amitoj", "Xavier", "Shaun", "Mary"};
firstName = firstNames[(int)(Math.random() *
firstNames.length)];
grade = (int)(Math.random() *
4) + 9;
String[]
schools = {"Lockerby", "Confed", "Lasalle", "Lo-Ellen"};
school = schools[(int)(Math.random() *
schools.length)];
}
public
String toString()
{
return grade + "
" + firstName + "
" + lastName + "
(" + school + ")";
}
}
|