2022-09-22 09:59:36 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Programmation_objet_TLESIO21.TD3.fleuriste;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Programmation_objet_TLESIO21.TD3 {
|
2022-10-06 10:41:21 +02:00
|
|
|
|
public static class TD4 {
|
2022-09-22 09:59:36 +02:00
|
|
|
|
|
|
|
|
|
public static void Exo1_1() {
|
|
|
|
|
Compte c1 = new Compte();
|
|
|
|
|
Compte c2 = new Compte();
|
|
|
|
|
|
|
|
|
|
c1.Deposer(500);
|
|
|
|
|
c2.Deposer(1000);
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(c1.ToString());
|
|
|
|
|
Console.WriteLine(c2.ToString());
|
|
|
|
|
|
|
|
|
|
c2.Retirer(10);
|
|
|
|
|
c1.VirerVers(75, c2);
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(c1.ToString());
|
|
|
|
|
Console.WriteLine(c2.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Exo1_2() {
|
|
|
|
|
Compte[] tab = new Compte[10];
|
|
|
|
|
for (int i = 0; i < tab.Length; ++i) {
|
|
|
|
|
tab[i] = new Compte();
|
|
|
|
|
tab[i].Deposer(200 + (100*i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < tab.Length; ++i) {
|
|
|
|
|
for (int j = i+1; j < tab.Length; ++j) {
|
|
|
|
|
tab[i].VirerVers(20, tab[j]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < tab.Length ; ++i) {
|
|
|
|
|
Console.WriteLine(i+1 + " : " + tab[i].ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Exo1_3() {
|
|
|
|
|
CompteCourant c = new CompteCourant("Applejack");
|
|
|
|
|
c.Deposer(500);
|
|
|
|
|
Console.WriteLine(c.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Launch() {
|
|
|
|
|
//Exo1_1();
|
|
|
|
|
//Exo1_2();
|
|
|
|
|
//Exo1_3();
|
|
|
|
|
TestBouquet.Exo2();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|