-
Notifications
You must be signed in to change notification settings - Fork 0
/
OPP.tcl
101 lines (71 loc) · 1.95 KB
/
OPP.tcl
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Class etudiant
etudiant etu
etudiant instproc show {} {
$self instvar nom prenom age cin cne note
puts "Nom :$nom"
puts "Prenom:$prenom"
puts "Age:$age"
puts "CIN:$cin"
puts "CNE:$cne"
puts "Note:$note"
}
etudiant instproc init { a b c d e f } {
$self instvar nom prenom age cin cne note
set nom $a
set prenom $b
set age $c
set cin $d
set cne $e
set note $f
}
etudiant instproc valide { } {
$self instvar nom prenom age cin cne note
if { $note ==20 } {
puts "Majorant de la promotion"
} elseif { $note <0 } {
puts "note erroné"
} elseif { $note< 5 } {
puts "Non validé"
} elseif { $note >=12 } {
puts "Validé"
} else {
puts "Rattrapage"
}
}
puts "*********************Etudiant 1*************************************"
etudiant op1 LARHCHIM ISMAIL 21 AD35874 J13326042 12
op1 show
puts -nonewline "Etat Note:"
op1 valide
puts "**********************Etudiant 2************************************"
etudiant op2 BENREFAD MEHDI 21 AD35764 J177826042 7
op2 show
puts -nonewline "Etat Note:"
op2 valide
puts "**********************Etudiant 3************************************"
etudiant op3 CHIBANE YAHYA 21 AD76874 J133SDS42 4
op3 show
puts -nonewline "Etat Note:"
op3 valide
puts "********************Modification de l'etudiant 1*******************************"
op1 set nom "MESSI"
op1 set prenom "LIONEL"
op1 set age 33
op1 show
puts -nonewline "Etat Note:"
op1 valide
puts "*********************Modification de l'etudiant 2******************************"
op2 set note 15
op2 show
puts -nonewline "Etat Note:"
op2 valide
puts "**********************Modification de l'etudiant 3*****************************"
op3 set note 20
op3 show
puts -nonewline "Etat Note:"
op3 valide
puts "**********************ReModification de l'etudiant 3******************************************************"
op3 set note -9
op3 show
puts -nonewline "Etat Note:"
op3 valide