je me demandais, j'ai envoyer ca a evans mais j'aimerais avoir votre avis si je suis dans le champ....
Sophie Dionne
22mars2007
======================================================
T: EchelonnerDesNotes
C : NB_ETUDIANT = 12
E : notes : TABLEAU[NB_ETUDIANT] d'ENTIER
S : echelon : TABLEAU[10] d'ENTIERS
Où echelon[1] sont les notes entre 0 inclus et 10 exclus (<10),
echelon[2] sont les notes entre 10 inclus et 20 exclus (<20),
...
echelon[10] sont les notes entre 90 inclus et 100 inclus(<=100).
VI:
noEtudiant: ENTIER
noEchelon: ENTIER
noteAuPlancher: ENTIER
======================================================
noEtudiant <-- 1
noEchelon <-- 0
noteAuPlancher <-- 0
TANT_QUE noEchelon <= 10 FAIRE
echelon[noEchelon] <-- 0
noEchelon <-- noEchelon + 1
FIN_TANT_QUE
LIRE(notes[noEtudiant])
1.TANT_QUE noEtudiant <= NB_ETUDIANT FAIRE
2.noteAuPlancher <-- notes[noEtudiant]
3.noteAuPlancher <-- (noteAuPlancher / 10)
4.TRONQUER (noteAuPlancher)
5.noteAuPlancher <-- noteAuPlancher + 1
6.SI noteAuPlancher < 11 ALORS
7.noEchelon <-- noteAuPlancher
8.echelon[noEchelon]<-- note[noEtudiant]
SINON
9.noteAuPlancher <-- noteAuPlancher - 1
10.noEchelon <-- noteAuPlancher
11.echelon[noEchelon] <-- note[noEtudiant]
12.noEtudiant <-- noEtudiant + 1
13.noteAuPlancher <-- 0
FIN_TANT_QUE
TRACE1:
notes[etudiant1]<-- 89
1. etudiant1 <= 12
2. 0 <-- 89
3. 89 <-- (89/10)
4. 8,9 <-- 8
5. 8 <-- 9
6. 9 < 11 = vrai
7. noEchelon <-- 9
8. echelon[9] <-- 89
12. etudiant 1 <-- etudiant 2
13. 89 <-- 0
TRACE2:
notes[etudiant2]<-- 100
1. etudiant2 <= 12
2. 0 <-- 100
3. 100 <-- (100/10)
4. 10 <-- 10
5. 10 <-- 11
6. 11 < 11= faux
9. 11 <-- 11 - 1
10. noEchelon <-- 10
11. echelon[10]<-- 100
12. etudiant 2 <-- etudiant 3
13. 100 <-- 0