Tester l'algorithme :
Graphique :
Code de l'algorithme :
1
VARIABLES
2
x EST_DU_TYPE NOMBRE
3
y EST_DU_TYPE NOMBRE
4
N EST_DU_TYPE NOMBRE
5
NbPointsTraces EST_DU_TYPE NOMBRE
6
Proportion EST_DU_TYPE NOMBRE
7
DEBUT_ALGORITHME
8
POUR N ALLANT_DE 1 A 250
9
DEBUT_POUR
10
x PREND_LA_VALEUR
11 random()
12
y PREND_LA_VALEUR
13 random()
14
AFFICHER N
15
AFFICHER x
16
AFFICHER " ;"
17
AFFICHER y
18
SI (y<=x*x) ALORS
19
DEBUT_SI
20
TRACER_POINT (x,y)
21
NbPointsTraces PREND_LA_VALEUR NbPointsTraces+1
22
FIN_SI
23
FIN_POUR
24
AFFICHER "Nombre de points tracés : "
25
AFFICHER NbPointsTraces
26
Proportion PREND_LA_VALEUR NbPointsTraces/250
27
AFFICHER "Porportion de points tracés : "
28
AFFICHER Proportion
29
FIN_ALGORITHME