Informatika fanidan 9-sinf uchun nazorat ishi topshiriqlari.
II variant.
1.Uchta a, b va c sonlar berilgan. Agar a2+b2=c2 shart bajarilsa, bu sonlarning yig`indisini , aks holda ularning modullari ko`paytmasini hisoblovchi dastur tuzing.
2.Erkin tushayotgan jismning t vaqt ichida bosib o`tgan yo`lini hisoblash dasturini tuzing.
3.“Obod turmush yili” matnini ekranning o`ng tomonidan 12-satrda yashil rangda , qizil fonda chiqaruvchi dastur tuzing.
Informatika fanidan 9-sinf uchun nazorat ishi topshiriqlari yechimlari
I variant.
1.Ikkita a va b sonlar berilgan. Agar b son a dan kichik bo`lsa, u holda b ni nol bilan almashtiruvchi, aks holda b ni o`zgarishsiz qoldiruvchi dastur tuzing.
Program masala;
Uses crt;
Var a,b: integer;
Begin
Write (‘ a ning qiymatini kirit’); Readln (a);
Write (‘ b ning qiymatini kirit’); Readln (b);
If a>b then b:=0 else Writeln (‘b=’,b);
Readln;
End.
2.Uzunligi 1m bo`lgan matematik mayatnikning tebranish davrini toppish dasturini tuzing.
Program masala;
Uses crt;
Var T, g: real;
Begin
g:= 9,8;
T: =2*Pi/sqrt(g);
Writeln (‘ T=’,T);
Readln;
End.
3.Ekranga 5 ta sinfdoshingizning ismin turli ranglarda va ekranning sariq rangida chiqaruvchi dastur tuzing.
Program masala;
Uses crt;
Begin
TextBackGround (14);
TextGolor (2); Writeln (‘Aqida’);
TextGolor (4); Writeln (‘Sitora’);
TextGolor (6); Writeln (‘Dostoni’);
TextGolor (3); Writeln (‘Husan’);
TextGolor (9); Writeln (‘Sevara’);
Readln;
End.
Informatika fanidan 9-sinf uchun nazorat ishi topshiriqlari yechimlari
II variant.
1.Uchta a, b va c sonlar berilgan. Agar a2+b2=c2 shart bajarilsa, bu sonlarning yig`indisini , aks holda ularning modullari ko`paytmasini hisoblovchi dastur tuzing.
Program masala;
Uses crt;
Var a,b,c,n: integer;
Begin
Write (‘ a ning qiymatini kirit’); Readln (a);
Write (‘ b ning qiymatini kirit’); Readln (b);
Write (‘ c ning qiymatini kirit’); Readln (c);
If sqr(a)+sqr(b)=sqr(c) then n:=a+b+c else n:=abs(a)*abs(b)*abs(c);
Writeln (‘n=’,n);
Readln;
End.
2.Erkin tushayotgan jismning t vaqt ichida bosib o`tgan yo`lini hisoblash dasturini tuzing.
Program masala;
Uses crt;
Var S,t, g: real;
Begin
g:= 9,8;
Write (‘ t ning qiymatini kirit’); Readln (t);
S: =g*sqr(t)/2;
Writeln (‘ S=’,S);
Readln;
End.
“Obod turmush yili” matnini ekranning o`ng tomonidan 12-satrda yashil rangda , qizil fonda chiqaruvchi dastur tuzing.
Program masala;
Uses crt;
Begin
TextGolor (2); TextBackGround(4);
Goto XY (65,12); Write (‘ Obod turmush yili’);
Readln;
End.
|