عملية الجمع والطرح والضرب والقسمة
صفحة 1 من اصل 1
عملية الجمع والطرح والضرب والقسمة
بسم الله الرحمن الرحيم
والصلاة والسلام على أشرف المرسلين سيدنا محمد صلى الله عليه وسلم وعلى آله وصحبه أجمعين
الحمد لله نحمده ونستغفره ونعوذ بالله من شرور انفسنا وسيئات اعمالنا
وأشهد أن لا إله إلا الله وحده لا شريك له وأشهد أن محمدا عبده ورسوله
CALCULE
والصلاة والسلام على أشرف المرسلين سيدنا محمد صلى الله عليه وسلم وعلى آله وصحبه أجمعين
الحمد لله نحمده ونستغفره ونعوذ بالله من شرور انفسنا وسيئات اعمالنا
وأشهد أن لا إله إلا الله وحده لا شريك له وأشهد أن محمدا عبده ورسوله
CALCULE
- الكود:
program calcule_12;
uses crt;
var i : integer;
{ declaration de procedure pour l"addition }
procedure addition; { ++ +++++++++++++++++++++++++++++++++ ++ }
procedure addition1;
var a,b,c : integer;
begin
i := 0;
writeln('...+. .+. Pour l"Addition .+. .+. .1.');
repeat
i := i + 1;
a := round(random(10));
b := round(random(10));
write(a,' + ',b,' = ');
readln(c);
if c = a + b then writeln(' Oui ce vrai egal ',c)
else writeln(' Non ce faux ',a,' + ',b,' = ',a + b);
until i >= 8;
end;
procedure addition2;
var a,b,c : integer;
begin
i := 0;
writeln('...+. .+. Pour l"Addition .+. .+. .2.');
repeat
i := i + 1;
a := round(random(20));
b := round(random(20));
write(a,' + ',b,' = ');
readln(c);
if c = a + b then writeln(' Oui ce vrai egal ',c)
else writeln(' Non ce faux ',a,' + ',b,' = ',a + b);
until i >= 10;
end;
procedure addition3;
var a,b,c : integer;
begin
i := 0;
writeln('...+. .+. Pour l"Addition .+. .+. .3.');
repeat
i := i + 1;
a := round(random(30));
b := round(random(30));
write(a,' + ',b,' = ');
readln(c);
if c = a + b then writeln(' Oui ce vrai egal ',c)
else writeln(' Non ce faux ',a,' + ',b,' = ',a + b);
until i >= 12;
end;
var choi : integer;
begin
clrscr;
repeat
writeln(' 1. Premier...+...');
writeln(' 2. Deuxieme...+...');
writeln(' 3. Troisieme...+...');
writeln(' 4. Retour...'); writeln;
write(' Entrez votre chois ? '); readln(choi);
case choi of
1:addition1;
2:addition2;
3:addition3;
end;
until choi>=4;
end;
{ +++++++++++++++++++++++++++++++++++++++++++++ }
{ declaration de procedure pour la soustration }
procedure soustraction; { --------------------------------------------- }
procedure soustraction1;
var a,b,c,x : integer;
begin
i := 0;
writeln('...-. .-. Pour la soustraction .-. .-. .1.');
repeat
i := i + 1;
a := round(random(10));
b := round(random(10));
if a < b then
begin
x := a;
a := b;
b := x;
end;
write(a,' - ',b,' = ');
readln(c);
if c = a - b then writeln(' Oui ce vrai egal ',c)
else writeln(' Non ce faux ',a,' - ',b,' = ',a - b);
until i >= 8;
end;
procedure soustraction2;
var a,b,c,x : integer;
begin
i := 0;
writeln('...-. .-. Pour la soustraction .-. .-. .2.');
repeat
i := i + 1;
a := round(random(20));
b := round(random(20));
if a < b then
begin
x := a;
a := b;
b := x;
end;
write(a,' - ',b,' = ');
readln(c);
if c = a - b then writeln(' Oui ce vrai egal ',c)
else writeln(' Non ce faux ',a,' - ',b,' = ',a - b);
until i >= 10;
end;
procedure soustraction3;
var a,b,c,x : integer;
begin
i := 0;
writeln('...-. .-. Pour la soustraction .-. .-. .3.');
repeat
i := i + 1;
a := round(random(30));
b := round(random(30));
if a < b then
begin
x := a;
a := b;
b := x;
end;
write(a,' - ',b,' = ');
readln(c);
if c = a - b then writeln(' Oui ce vrai egal ',c)
else writeln(' Non ce faux ',a,' - ',b,' = ',a - b);
until i >= 12;
end;
var choi1 : integer;
begin
clrscr;
repeat
writeln(' 1. Premier...-...');
writeln(' 2. Deuxieme...-...');
writeln(' 3. Troisieme...-...');
writeln(' 4. Retour...'); writeln;
write(' Entrez votre chois ? '); readln(choi1);
case choi1 of
1:soustraction1;
2:soustraction2;
3:soustraction3;
end;
until choi1>=4;
end;
{ -------------------------------------- }
{ declaration de procedure pour la multiplication }
procedure multiplication;
var a,b,c : integer;
begin
i := 0;
writeln('...*. .*.Pour La multiplication .*. .*.');
repeat
i := i + 1;
a := round(random(10));
b := round(random(10));
write(a,' * ',b,' = ');
readln(c);
if c = a * b then writeln(' Oui ce vrai egal ',c)
else writeln(' Non ce faux ',a,' * ',b,' = ',a * b);
until i >= 5;
end;
{ declaration de procedure pour la multiplication }
procedure division;
var a,b,c,d : integer;
begin
i := 0;
writeln('.../. ./.Pour La Division ./. ./.');
repeat
i := i + 1;
a := round(random(10));
b := round(random(10));
if b = 0 then b := 5;
write(a,' / ',b,' = ');
read(c); write(' + '); read(d);
if d + c = (a div b)+(a mod b) then
writeln(' Oui ce vrai egal ',a div b,' + ',a mod b)
else writeln(' Non ce faux ',a,' / ',b,' = ',a div b,' + ',a mod b);
until i >= 4;
end;
{ Programmer principal}
var chois : integer; { Delaration Du Variable Locale De Programmer}
begin
clrscr;
repeat
writeln;
writeln('1. Addition...+...');
writeln('2. Soustraction...-...');
writeln('3. Multiplication...*...');
writeln('4. Division.../...');
writeln('5. Quitter'); writeln;
write(' Entrez votre chois ? '); readln(chois);
randomize;
case chois of
1: addition;
2: soustraction;
3: multiplication;
4: division;
end;
until chois >=5;
TextMode(0);
end.
صفحة 1 من اصل 1
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى