Mobile ilovalar yaratishda Dart dasturlash tilining o'rni va ahamiyati Ermonov Sherzod Ibrayim o'g'li Guliston Davlat Universiteti magstranti Anotatsiya


Download 1.23 Mb.
bet2/5
Sana14.11.2023
Hajmi1.23 Mb.
#1771866
1   2   3   4   5
Bog'liq
Mobile ilovalar yaratishda Dart dasturlash tilining o

void main() {
var yigingi = 0;
double orta_qiymat=0;
for (int i = 1; i <= 99; i++) {
yigingi += i;
}
orta_qiymat=yigingi/99;
print(orta_qiymat);
}

2.3 xonali sonlar ichidan 11 ga bo'linadiganlarining yig'indisini toping ?
void main() {
var yigingi = 0;
for (int i = 100; i <= 999; i++) {
if (i % 11 == 0) {
yigingi += i;
}
}
print(yigingi);
}

3. Quyidagi matndan faqat lotin harflarini ajratib bering : " 2021 йил Flutter Uzbek дарслари " ?
void main() {
var text = "2021 йил Flutter Uzbek дарслари";
for (int i = 0; i < text.length; i++) {
var a = text.codeUnitAt(i);
if (a >= 48 && a <= 57 || a >= 65 && a <= 90 || a >= 97 && a <= 122) {
var b = text[i];
print(b);
}
}
}

4. Berilgan matnda nechta + va – belgilari borligini aniqlovchi dastur tuzing ?
void main() {
var text = "253+46-32-323+548+4548-64-98";
var b = 0, c = 0;
for (int i = 0; i < text.length; i++) {
var a = text.codeUnitAt(i);
if (a <= 43) {
b += 1;
} else if (a <= 45) {
c += 1;
}
}
print('+ lar soni $b ');
print('- lar soni $c ');
}

5. Kiritilgan belgi raqam belgi bo'lsa "digit", agar lotin harfi bo'lsa "letter", boshqa hollarda esa '0' raqami chop etilsin ?
void main() {
var text = "5";
for (int i = 0; i < text.length; i++) {
var a = text.codeUnitAt(i);
if (a >= 48 && a <= 57) {
print("digit");
} else if (a >= 65 && a <= 90 || a >= 97 && a <= 122) {
print("latter");
} else {
print("0");
}
}
}
6. Quyida kiril alifbosida matn berilgan. Uni lotin alifbosiga o'tkazing "Аканг уже кучайди" ?
void main() {
String text = "Аканг ужи кучай_ди";
var list = [];
list.add(text.codeUnitAt(0));
list.add(text.codeUnitAt(1));
list.add(text.codeUnitAt(2));
list.add(text.codeUnitAt(3));
list.add(text.codeUnitAt(4));
list.add(text.codeUnitAt(5));
list.add(text.codeUnitAt(6));
list.add(text.codeUnitAt(7));
list.add(text.codeUnitAt(8));
list.add(text.codeUnitAt(9));
list.add(text.codeUnitAt(10));
list.add(text.codeUnitAt(11));
list.add(text.codeUnitAt(12));
list.add(text.codeUnitAt(13));
list.add(text.codeUnitAt(14));
list.add(text.codeUnitAt(15));
list.add(text.codeUnitAt(16));
list.add(text.codeUnitAt(17));
list[0] = 65;
list[1] = 107;
list[2] = 101;
list[3] = 110;
list[4] = 103;
list[5] = 32;
list[6] = 117;
list[7] = 106;
list[8] = 105;
list[9] = 32;
list[10] = 107;
list[11] = 117;
list[12] = 99;
list[13] = 104;
list[14] = 97;
list[15] = 121;
list[16] = 100;
list[17] = 105;
String a = "";
for (var b in list) {
a = a + new String.fromCharCode(b);
} print(a); }

7. Fibonachchi ketma ketligining n – hadini rekursiv funksiya orqali hisoblovchi dastur tuzing ?
void main() {
int n = fibonachchi(8);
print(n);
}
int fibonachchi(int a) {
if (a == 0 || a==1) {
return a;}
if(a==2){
return 1;
}
return fibonachchi(a-1) + fibonachchi(a-2);
}

8. Berilgan List da mavjud sonlarning o'rtacha garmonik qiymatini topuvchi Class va funksiya yozing ? N list uzunligi.
Harmonic mean = n / ((1/x1) + (1/x2) + (1/x3) + … + (1/xn));

Download 1.23 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5




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