Page 680 - IT2
P. 680
class Program
{
static void Main(string[] args)
{
Habit h1 = new Habit("hx123", 180, 1500, 300, 36, "rouge");
h1.Achat(90);
Console.WriteLine(h1.ToString());
Electromenager e1 = new Electromenager("Ex123", 12000, 1500,
30, 45, 12);
e1.Sapprovisionner(100);
Console.WriteLine(e1.ToString());
Console.WriteLine(e1.datefinGarantie());
Console.ReadLine();
}
}
Dossier 3: Programmation événementielle
1. le code permettant de remplir la liste
comboBox1.Items.Add("A");
comboBox1.Items.Add("B");
comboBox1.Items.Add("AB");
comboBox1.Items.Add("O");
2. le code du bouton "Nouveau » :
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
comboBox1.Text = "";
radioButton1.Checked = false;
radioButton2.Checked = false;
3. le code du bouton " Ajouter» :
char rh='+';
if (radioButton1.Checked==false) rh='-';
dataGridView1.Rows.Add(textBox1.Text, textBox2.Text,
textBox3.Text,comboBox1.Text,rh);
Filière Epreuve Session 9/10
DI Synthèse V1(Correction) Juillet 2015

