package mycode;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Robin
 */
//Question 2
//Q2.1 - 3
//header correct
public class Candidate {
    //properties private
    //named and typed correctly
    private String studentID;
    private String name;
    private int year;
    
    //Q2.2 - 4
    //header correct
    //correct parameter names and types
    public Candidate(String inSID, String inNE, int inYR)
    {
        //properties assigned correctly
        studentID = inSID;
        name = inNE;
        year = inYR;
    }
    //Q2.3 - 2
    //correct header and return types for all three getters
    public String getStudentID()
    {
        return studentID;
    }
    
    public String getName()
    {
        return name;
    }
    
    public int getYear()
    {
        return year;
    }
    //Q2.4 - 4
    //header correct
    public String toString()
    {
        //contains all fields
        //fields in correct format
        //returned correctly
        return name + " [" + studentID + "] year " + year;
    }
}
