summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormokha <mokha@cisco.com>2019-05-04 11:17:07 -0600
committermokha <mokha@cisco.com>2019-05-04 11:17:07 -0600
commitaa463d4a11e0edfce45f506a40a5307b9acf3e3d (patch)
treec7c04f581ef46c2587d49cc75016da3451c507fa
parent9cd1f6bed8e0b2eb3283ebfa7a3bcc81f20f3c20 (diff)
try to obey coding standards
-rw-r--r--assignments/assignment1/src/main/java/ca/mokhan/assignment1/EmployeeSavings.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/assignments/assignment1/src/main/java/ca/mokhan/assignment1/EmployeeSavings.java b/assignments/assignment1/src/main/java/ca/mokhan/assignment1/EmployeeSavings.java
index 8bd322b..aa3180f 100644
--- a/assignments/assignment1/src/main/java/ca/mokhan/assignment1/EmployeeSavings.java
+++ b/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()
+ );
}
}