// Arup Guha
// 3/8/2026
// Solution for COP 3330 Quiz 3 Question 8.

public class MathArticle implements ResearchPaper {

    private int numAuthors;
    private String[] authorList;
    
	public MathArticle(String[] peeps) {
		authorList = peeps;
		numAuthors = peeps.length;
	}
	
	public String getNthAuthor(int n) {
		
		// Out of bounds.
		if (n<1 || n>numAuthors) return null;
		
		// We're good;
		return authorList[n-1];
	}
	
	public static void main(String[] args) {
	
		// Basic test for all relevant indexes.
		String[] names = {"Abigail", "Belly", "Carmen", "Demeter", "Edward"};
		MathArticle paper = new MathArticle(names);
		for (int i=0; i<7; i++) 
			System.out.println(paper.getNthAuthor(i));
	}

}
