Explorați Cărți electronice
Categorii
Explorați Cărți audio
Categorii
Explorați Reviste
Categorii
Explorați Documente
Categorii
Subiect
Punctaj
1.
2.
Se consider antetul:
function F(x:real; y:integer; z:char):boolean;.
Care din apelurile ce urmeaz snt corecte:
a) F(3.18, 4, a);
b) F(15, 21, 3);
c) F(15, 21, 3); ?
3.
4.
function F1(x:integer):integer;
begin
F1:=x+c;
end;
function F2(c:real):real;
const x=2.0;
begin
F2:=x+c;
end;
function F3(x:char):char;
const c=3;
begin
F3:=chr(ord(x)+c);
end;
begin
writeln(F1=, F1(1));
writeln(F2=, F2(1));
writeln(F3=, F3(1));
readln;
end.
5.
6.
Care este cauza efectelor colaterale? Ce consecine pot avea aceste efecte?
7.
function F(x:integer):integer;
begin
F:=a*x;
b:=b+1;
end;
function G(x:integer):integer;
begin
G:=b+x;
a:=a+1;
end;
begin
a:=1; b:=1;
writeln(F(1));
writeln(G(1));
writwln(F(1));
writeln(F(1));
readln;
end.
8.
Total
40
Barem de notare i convertire
Punctaj 40
Nota
10
39-37
9
36-33
8
32-27
7
26-20
6
19-13
5
12-8
4
7-3
3
2
2
Subiect
Punctaj
1.
2.
Se consider antetul:
function F(x:real; y:integer; z:char):boolean;.
Care din apelurile ce urmeaz snt corecte:
a) F(4, 4, 4);
b) F(4, 3.18, 3);
c) F(1.5, -21, 3); ?
3.
4.
procedure P(b:real);
var c:real;
procedure Q(d:integer);
var c:char;
begin
c:=chr(d);
writeln(in procedura Q c= , c);
end;
begin
writeln(b=, b);
c:=b+1;
writeln(in procedura P c= , c);
Q(35);
end;
function F(x:real):real;
begin
F:=x/2;
end;
5.
begin
a:=F(5);
writeln(a=, a);
P(a);
readln;
end.
Numii variabilele locale i globale din programul P1 de la itemul 4.
6.
7.
8.
Total
40
Barem de notare i convertire
Punctaj 40
Nota
10
39-37
9
36-33
8
32-27
7
26-20
6
19-13
5
12-8
4
7-3
3
2
2