
public class StudentNodeLinkedList
{
    private StudentNode head;

    public StudentNodeLinkedList( )
    {
        head = null;
    }

    /**
     Adds a node at the start of the list. The added node has addData
     as its data. The added node will be the first node in the list.
    */
    public void addANodeToStart(String last_name, String first_name)
    {
        head = new StudentNode(last_name,first_name, head);
    }

    public void deleteHeadNode( )
    {
        if (head != null)
        {
            head = head.getLink( );
        }
        else
        {
            System.out.println("Error: Attempt to delete from an empty list.");
            System.out.println("\n\nQuitting program...");
            System.exit(0);
        }
    }

   
    public void showList( )
    {
        StudentNode position;
        position = head;
        while (position != null)
        {
            System.out.println(position.getLastname( ));
            System.out.println(position.getFirstname( ));
            System.out.println(position.getScore( ));
            position = position.getLink( );
        }
        System.out.println("Press any key to continue...");
        SavitchIn.readLine();
    }

}

