|
Heres the whole problem
import java.util.*;
import java.lang.String.*;
/**
* The System basically put's the information of all the people looking for work
* and all their details are on the system.
*
* @Author RioAntonio Drayton
* @Version 2008.04.04
*/
public class System
{
private String advisor;
private String desk;
private String timeAndDay;
private List <Person> persons;
private int capacity;
/**
* This creates a new system with the number of applicants. Some details
* are set to unknown.
*/
public System (int numberOfApplicants)
{
advisor = "unknown";
desk = "unknown";
timeAndDay = "unknown";
persons = new ArrayList<Person>();
capacity = numberOfApplicants;
}
/**
* Add applicants to the system.
*/
public void addApplicant (Person newPerson)
{
if(persons.size() == capacity) {
System.out.println("All advisors are busy, please come back later." );
}
else {
persons.add(newPerson);
}
}
/**
* Return the number of apllicants thats registered details.
*/
public int numberOfApplicants()
{
return persons.size();
}
}
|