1-amaliy mashg’ulot. Mavzu: Bir masala uchun turli uslubda dastur tuzish


Download 12.88 Kb.
bet3/3
Sana08.11.2023
Hajmi12.88 Kb.
#1756110
1   2   3
Bog'liq
1 amaliy mashg’ulot Mavzu Bir masala uchun turli uslubda dastu fayllar

C++ (imperativ)


SQL (deklarativ)

int N[]= { 5, 1, 3, 9, 12, 583, 998, 7538, 72, 53, 71, 85, 7, 2, 9 };


for(int i = 0; i < 15; i++)
if(N[i] > 3 && N[i] < 100) cout<

SELECT num FROM N WHERE num > 3 AND num < 100;




XULOSA. Yuqoridagi misollardan ko’rinadiki, deklarativ dasturlashda dasturchi NIMA kerak ekanligini yozadi, imperative dasturlashda esa natijani QANDAY olish kerak ekanligini yozadi.
Mustaqil yechish uchun masalalar.
1.Elementlari 5,1,3,9,12,583,998,7538,72,53,71,85,7,2,9 sonlardan iborat massiv berilgan. Mazkur massivning elementlari orasidan eng kattasi topilsin.
2.Elementlari 5,1,3,9,12,583,998,7538,72,53,71,85,7,2,9 sonlardan iborat massiv berilgan. Mazkur massivning elementlari orasidan eng kichigi topilsin.
3.Quyida quyoshning sayyoralarini tavsiflovchi Planets jadvali berilgan. Xalqasi bor(HavingRangs) sayyoralar ekranga chiqarilsin.


ID


PlanetName


Radius


SunSeason


OpeningYear


HavingRings


Opener

1

Mars

3396

687

1659

No

Christiaan Huygens


2

Saturn

60268

10759.22


Yes


3

Neptune

24764

60190

1846

Yes

John Couch Adams

4

Mercury

2439

115.88

1631

No

Nicolaus Copernicus


5

Venus

6051

243

1610

No

Galileo Galilei


4. Quyida Universities jadvali berilgan. Fakultetlari soni 20 tadan ko’p bo’lgan universitetlar soni aniqlansin.






ID


UniversityName


Students


Faculties


Professores


Location

1

Perm State National Research University

12400

12

1229

Perm

2

Saint Petersburg State University

21300

24

13126

Saint-Petersburg

3

Novosibirsk State University

7200

13

1527

Novosibirsk

4

Moscow State University

35100

39

14358

Moscow

5

Higher School of Economics

20335

12

1615

Moscow

6

Ural Federal University

57000

19

5640

Yekaterinburg

7

National Research Nuclear University

8600

10

936

Moscow

5. Elementlari 5,1,3,0,12,0,998,0,72,53,0,85,7,2,9 sonlardan iborat massiv berilgan. Massivda nechta 0 borligini aniqlansin.


http://fayllar.org
Download 12.88 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling