public class AssignmentTwo
{
static Console c; // The output console
public static void main (String[] args)
{
c = new Console ();
c.println ("How many students' names do you want to enter?");
int num = c.readInt ();
c.clear ();
String name[] = new String [num];
String lname[] = new String [num];
int age[] = new int [num];
int student[] = new int [num];
int max[] = new int [num];
String a = ("Name");
String b = ("/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\");
for (int i = 0 ; i < num ; i++)
{
c.println ("What is the student's first name?");
name [i] = c.readString ();
c.println ("What is the student's last name?");
lname [i] = c.readString ();
c.println ("What is the student's age?");
age [i] = c.readInt ();
c.println ("What is the student's number?");
student [i] = c.readInt ();
if (student [i] > max [i])
{
student [i] = max [i];
}
}
c.clear ();
c.print (" ", 40 - b.length () / 2);
c.println (b, 40 - "Student Info".length () / 2);
c.print (" ", 45 - b.length () / 2);
c.println ("Student Info", 40 - b.length () / 2);
c.print (" ", 40 - b.length () / 2);
c.println (b);
c.println ();
c.print ("Name", 20);
c.print ("Last Name", 20);
c.print ("Age", 20);
c.println ("Student Number");
for (int i = 0 ; i < num ; i++)
{
c.print (name [i], 20);
c.print (lname [i], 20);
c.print (age [i], -10);
c.println (student [i], 29);
}
}
}