Vous êtes sur la page 1sur 7

Test N°:01Gestion 2 EME

ANNEE // L.T.Pascal
Juste Observation (c’est quoi
PROGRAM Pascal (PR.PA)
l’erreur) sur texte
Point
oui non
PROGRAM Test 1;
VAR x, y, z, a, b, c, d, : real;
BEGIN
Write ('a b ? '); readln (a, b);
x =: a, y =: b;
z =: x * y.
c= z ;
x = : a-1 : y := b+1 ;
d = : z,
writeln (‘c = ‘, c,d = ‘, d);
END.

Page 1 sur 7
Test N°:01Gestion 2 EME
ANNEE // L.T.Pascal
Juste Observation (c’est quoi l’erreur)
PROGRAM Pascal (PR.PA) Point
oui non sur texte
PROGRAM Test 2 ;
VAR x, y, : integer;
BEGIN
Clrscrt;
x := 4;
writln ('toto x =, x);
x := 2;
writln ('glob x = ' x);
writln ('glob x = ' x);
Readky;
END.

Page 2 sur 7
Test N°:01Gestion 2 EME
ANNEE // L.T.Pascal
Juste Observation (c’est quoi l’erreur)
PROGRAM Pascal (PR.PA)
sur texte
Point
oui non
program Frise_DeN_2; x
uses crts; x s
var x, J, : integer; , J,
begin
ag, x ,
for J = : 1 to 16 do x =:
begin
av; av; pdt, vg; vd:pdt; , // :
End. x ; .
st;
End ; X End ;
End.

Page 3 sur 7
Test N°:01Gestion 2 EME
ANNEE // L.T.Pascal
Juste Observation (c’est quoi l’erreur)
PROGRAM Pascal (PR.PA) Point
oui non sur texte
program Piquets En Dents DeScie ; x espace
uses crt; x
var I : integer; J : integer; K : integer; x
Begin x
ag; x
for I =: 1 to 40 do x :=
begin
for J =: 1 to 2 do x :=
begin x
for K =: 1 to do x :=
begin
av; x
end. x ;
pdt; x
end, x ,
pqtd; av; pqtg; x
end; x
st; x
End. x
Page 4 sur 7
Test N°:01Gestion 2 EME
ANNEE // L.T.Pascal
Program Pascal (Pr.Pa) Algorithme Point
Program compta ;
Uses crt ;
Var HT, TTC, TVA : real ;
Begin
Textcolor (yellow);
Textbackground (red);
clrscr;
Write (‘Donner un montant hors taxe :’) ;
Readln (HT) ;
TVA := HT * 0.2 ;
TTC := HT + TVA;
Writeln (‘La TVA est : ‘, TVA) ;
Writeln (‘La TTC est : ‘, TTC) ;
End.

Algorithme Program Pascal (Pr.Pa) Point


Page 5 sur 7
Algorithme Max ;
Test N°:01Gestion 2
Program Max ;
EME
ANNEE // L.T.Pascal
Variable X,Y :Reel; Var X, Y :Real ;
Debut Begin
Lire (X) ; Lire(Y) ; Readln (X) ; Readln (Y) ;
Si (X >Y)Alors If (X > Y) Then
Ecrire (‘’Le maximum est’’, X) Writeln (‘Le maximum est’, X)
Sinon Else
Si (Y > X) Alors If (Y > X) Then
Ecrire (‘’Le maximum est’’, Y) Writeln (‘Le maximum est’, Y)
Sinon Else
Ecrire (‘Pas de maximum ’) writeln (‘Pas de maximum’);
FinSi End.
FinSi
Fin.

Algorithme Somme; program Somme;


variable i,N,S :Entier; var i, N, S :integer;
Debut begin
Affichier('Donner le nombre : '); write('Donner le nombre : '); readln(N);
Lire (N); i:=0;
i0; S:=0;
S0; while (i<N)do
Tantque (i<N)Faire begin
Debut S:=S+i;
SS+i; i:= i+1
i i+1 end;
Fin; writeln ('La somme de ',N,' premier nombre est : ',S) ;
Ecrire ('La somme de ',N,' premier nombre est :',S) end.
Fin

Page 6 sur 7
Exemple 3 :
Test N°:01Gestion 2 EME
ANNEE // L.T.Pascal
Ecrire un programme pascal qui permet de calculer la TVA et TTC d’un montantHT ?
Spécification des sorties : TVA, TTC
Spécification des entrées : HT
Spécification des traitements : TVA = HT * 20% , TTC = HT + TVA
Solution :
Program compta ;
Uses crt ;
Var HT, TTC, TVA : real ;
Begin
Textcolor(yellow);
Textbackground(red);
clrscr;
Write(‘Donner un montant hors taxe :’) ;
Readln(HT) ;
TVA := HT * 0.2 ;
TTC := HT + TVA;
Writeln(‘La TVA est : ‘,TVA);
Writeln(‘La TTC est : ‘,TTC) ;
End

Page 7 sur 7

Vous aimerez peut-être aussi