Merge pull request #4 from Klagarge/coments-on-saving-account

finish comments on saving account
This commit is contained in:
Rémi Heredero 2022-05-15 18:28:14 +02:00 committed by GitHub
commit 392cc6d8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

Binary file not shown.

View File

@ -4,16 +4,17 @@ import hevs.utils.DateUtils;
import java.util.Date; import java.util.Date;
/** /**
* * Create a bank account with specification : compte épargne
* - you have some interest for the money you have on this account
*/ */
public class Savings extends BankAccount{ public class Savings extends BankAccount{
private double interestRate; private double interestRate;
/** /**
* * Create a new saving account with all parameters
* @param owner * @param owner The people who have the bank account
* @param amount * @param amount The amount on this bank account at the time of opening
* @param interestRate * @param interestRate the interest rate for this account
*/ */
protected Savings(String owner, double amount, double interestRate){ protected Savings(String owner, double amount, double interestRate){
if(owner==null){ if(owner==null){
@ -34,10 +35,10 @@ public class Savings extends BankAccount{
} }
/** /**
* * Calculates how much interest is charged over a given period of time
* @param a * @param a Initial date for counting interest
* @param b * @param b Final date for counting interest
* @return * @return The interest earned during the period
*/ */
protected double calcInterest(Date a, Date b){ protected double calcInterest(Date a, Date b){
double days = DateUtils.nDays(a, b); double days = DateUtils.nDays(a, b);