forked from AhmedGrati/.net_TP1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CompteEpargne.cs
38 lines (36 loc) · 1.16 KB
/
CompteEpargne.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections;
namespace TP1
{
public class CompteEpargne : Compte
{
float taux;
public CompteEpargne(float solde, string nomProp, ArrayList op, float taux) : base(solde, nomProp, op)
{
this.taux = taux;
}
public override void afficher()
{
Console.WriteLine("Résumé du compte de " + base.nomProp);
Console.WriteLine("--------------");
Console.WriteLine("Compte Courant de" + base.nomProp);
Console.WriteLine("Solde: " + base.solde);
Console.WriteLine("Taux: " + this.taux);
Console.WriteLine();
Console.WriteLine("Opérations: ");
base.afficher();
}
public override void crediter(float somme)
{
base.solde += somme + somme * taux;
base.operations.Add("+" + somme);
}
public override void crediter(float somme, Compte compte)
{
base.solde += somme + somme * taux;
compte.solde -= somme;
base.operations.Add("+" + somme);
compte.operations.Add("-" + somme);
}
}
}