Etudes/BTS/Java/Premiere annee/testcompteepargne/CompteEpargne.java

44 lines
819 B
Java
Raw Normal View History

2016-10-14 15:52:18 +00:00
/*
* 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.
*/
package testcompteepargne;
/**
*
* @author therbron
*/
public class CompteEpargne extends CompteBancaire{
private double tauxInteret;
CompteEpargne()
{
super();
tauxInteret = 0.03;
}
CompteEpargne(double solde, double tauxInteret)
{
super(solde);
this.tauxInteret = tauxInteret;
}
double calculerInteret()
{
return tauxInteret * solde;
}
void crediterInteret()
{
solde = solde + calculerInteret();
}
void changerTaux(double tauxInteret)
{
this.tauxInteret = tauxInteret;
}
}