Commit aa463d4
Changed files (1)
assignments
assignment1
src
main
java
ca
mokhan
assignment1
assignments/assignment1/src/main/java/ca/mokhan/assignment1/EmployeeSavings.java
@@ -12,22 +12,24 @@ public class EmployeeSavings extends AddressBook
private double accountValue;
private double[] monthlyInterests;
private double[] monthlySavings;
- public static final double ANNUAL_INTEREST_RATE = 0.05;
-
private double monthlyContribution;
+ public static final double ANNUAL_INTEREST_RATE = 0.05;
- public EmployeeSavings(String firstName, String lastName) {
+ public EmployeeSavings(String firstName, String lastName)
+ {
this(firstName, lastName, new Random().nextInt(800 - 100) + 100.0);
}
- public EmployeeSavings(String firstName, String lastName, double monthlyContribution) {
+ public EmployeeSavings(String firstName, String lastName, double monthlyContribution)
+ {
super(firstName, "", lastName);
this.monthlyContribution = monthlyContribution;
this.accountValue = predictBalanceAfterMonths(12);
}
// what is d1, d2?
- public EmployeeSavings(String firstName, String lastName, double[] d1, double[] d2) {
+ public EmployeeSavings(String firstName, String lastName, double[] d1, double[] d2)
+ {
super(firstName, "", lastName);
}
@@ -81,6 +83,11 @@ public class EmployeeSavings extends AddressBook
public String toString()
{
Currency currency = Currency.getInstance(Locale.getDefault());
- return String.format("%s %s%.2f", super.getFirstName(), currency.getSymbol(), this.getAccountValue());
+ return String.format(
+ "%s %s%.2f",
+ super.getFirstName(),
+ currency.getSymbol(),
+ this.getAccountValue()
+ );
}
}