import java.util.Date; /** * This class will hold the account information of a retirement account * for a particular year. */ public class AccountInformation { ///////////////////////////////////////////// // Member Variables // ///////////////////////////////////////////// /** The starting balance of the account for this year. */ private double startBalance; /** The ending balance of the account for this year. */ private double endBalance; /** The contribution made into this account during the year. */ private double contribution; /** The interest earned by this account during the year. */ private double interestEarned; /** The Date of the last day of the fiscal year. */ private Date informationDateStamp; ///////////////////////////////////////////// // Constructors // ///////////////////////////////////////////// /** Creates an AccountInformation object. */ public AccountInformation() { startBalance = 0; endBalance = 0; contribution = 0; interestEarned = 0; informationDateStamp = new Date(); } /** * Creates an AccountInformation object. */ * @param start * @param end * @param contrib * @param earned * @param dateStamp */ public AccountInformation( double start, double end, double contrib, double earned, Date dateStamp) { startBalance = start; endBalance = end; contribution = contrib; interestEarned = earned; informationDateStamp = dateStamp; } ///////////////////////////////////////////// // Methods // ///////////////////////////////////////////// /** Returns the starting balance of this account. */ public double getStartBalance() { return( startBalance);} /** * Sets the starting balance of this account. * @param start The balance to use as the starting balance. */ public void setStartBalance( double start) { startBalance = start;} /** Returns the ending balance of this account. */ public double getEndBalance() { return( endBalance);} /** * Sets the ending balance of this account. * @param end The balance to use as the ending balance. */ public void setEndBalance( double end) { endBalance = end; } /** Returns the contribution into this account during the year. */ public double getContribution() { return( contribution);} /** * Sets the contribution level for the year. * @param contrib The amount contributed. */ public void setContribution( double contrib) { contribution = contrib;} /** Returns the interest earned by the account for the year. */ public double getInterestEarned() { return( interestEarned);} /** * Sets the amount of interest earned. * @param earned The amount of interest earned by the account. */ public void setInterestEarned( double earned) { interestEarned = earned; } /** Returns the Date object representing the last day of the fiscal year. */ public Date getDateStamp() { return( informationDateStamp);} /** * Sets the date of the fiscal year. * @param aDate The Date object for this year. */ public void setDateStamp( Date aDate) { informationDateStamp = aDate;} }