• 2- MUSTAQIL ISHI Tekshirdi: Mahkamova D Bajardi: Nematova E SAMARQAND 2023
  • Muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti samarqand filiali kompyuter injiniringi fakulteti




    Download 0.71 Mb.
    Sana12.11.2023
    Hajmi0.71 Mb.
    #97602
    Bog'liq
    E2 Dasturlash
    5 SINF2-mak.Axmedova.S, 2-MA\'RUZA TAQDIMOTI, sharti-oldindan-beriluvchi-sharti, namunaviy-dastur, 2-21 guruhi 1-simmestr, sherzod YUMB, YOQUBJON PAPKASI, Бошлангич-таълим-1-булим-туплам (1), ASOSIY kalit, ISH rejasining yuzi Norqizilov Mansur (2), 14-dars, TOBE TEST, o\'zbek tili, 1,2,3

    O‘ZBEKISTON RESPUBLIKASIAXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI

    MUHAMMAD AL-XORAZMIY NOMIDAGI
    TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI SAMARQAND FILIALI

    KOMPYUTER INJINIRINGI FAKULTETI

    21-04-guruh
    Nematova Elnura
    2- MUSTAQIL ISHI
    Tekshirdi: Mahkamova D
    Bajardi: Nematova E

    SAMARQAND 2023
    #include
    #include
    using namespace std;
    int main() {
    double x = 0; // boshlang'ich qiymat
    double y1, y2; // funksiya qiymatlari
    y1 = sin(x); // funksiya qiymati x da
    y2 = sin(x+1); // funksiya qiymati x+1 da
    if (y1 == y2) { // ildizga ega bo'lsa
    cout << "Funksiya X, X+1 oraliqda ildizga ega" << endl;
    } else { // ildizga ega emas
    cout << "Funksiya X, X+1 oraliqda ildizga ega emas" << endl;
    }
    return 0;
    }



    #include


    using namespace std;
    int main() {
    int speed;
    cout << "Tezlikni kiriting: ";
    cin >> speed;
    if (speed <= 30) {
    cout << "You are following the traffic rules.\n";
    } else {
    cout << "You have violated the traffic rules.\n";
    }
    return 0;
    }




    #include


    #include // sqrt() funksiyasi uchun kerak
    using namespace std;
    int main() {
    int x1, y1, x2, y2, x3, y3;
    cout << " birinchi nuqtaning koordinatalarini kiriting: ";
    cin >> x1 >> y1;
    cout << "ikkinchi nuqtaning koordinatalarini kiriting: ";
    cin >> x2 >> y2;
    cout << " uchunchi nuqtaning koordinatalarini kiriting: ";
    cin >> x3 >> y3;
    // Uchburchakning to'g'ri chiziqqa tushirilgan burchagi
    double a = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
    double b = sqrt(pow(x3 - x2, 2) + pow(y3 - y2, 2));
    double c = sqrt(pow(x1 - x3, 2) + pow(y1 - y3, 2));
    // Perpendikulyar bo'lgan kesmalar uzunliklari
    double d1, d2, d3;
    if (a > b && a > c) {
    d1 = b;
    d2 = c;
    d3 = a;
    } else if (b > a && b > c) {
    d1 = a;
    d2 = c;
    d3 = b;
    } else {
    d1 = a;
    d2 = b;
    d3 = c;
    }
    // Perpendikulyar bo'lganligini tekshirish
    if (pow(d1, 2) + pow(d2, 2) == pow(d3, 2)) {
    cout << "The line segment connecting the first and third points is perpendicular to the line segment connecting the second and third points.\n";
    } else {
    cout << "The line segment connecting the first and third points is not perpendicular to the line segment connecting the second and third points.\n";
    }
    return 0;
    }




    #include


    using namespace std;
    int main() {
    double fuelEfficiency, distanceToGasStation, gasTankCapacity, fuelRemaining;
    cout << " avtomobilning yoqilg'i samaradorligini kiriting (gallon uchun milda): ";
    cin >> fuelEfficiency;
    cout << " avtomobilning yoqilg'i samaradorligini kiriting (gallon uchun milda): ";
    cin >> distanceToGasStation;
    cout << " avtomobilning yoqilg'i samaradorligini kiriting (gallon uchun milda): ";
    cin >> gasTankCapacity;
    cout << " avtomobilning yoqilg'i samaradorligini kiriting (gallon uchun milda): ";
    cin >> fuelRemaining;
    double distancePossible = fuelEfficiency * gasTankCapacity; // Masofa, qancha benzin borligiga qarab
    double distanceRemaining = distancePossible - distanceToGasStation; // Qolgan masofa, shaxobchaga yetish uchun
    if (distanceRemaining <= 0) {
    cout << "You will not be able to reach the gas station.\n";
    } else {
    if (distanceRemaining <= fuelRemaining * fuelEfficiency) {
    cout << "You have enough fuel to reach the gas station.\n";
    } else {
    cout << "You do not have enough fuel to reach the gas station.\n";
    }




    }
    return 0;
    }

    #include


    #include
    using namespace std;
    int main() {
    double a, b, c, d;
    cout << "yon tomonning uzunligini kiriting a: ";
    cin >> a;
    cout << " yon tomonning uzunligini kiriting b: ";
    cin >> b;
    cout << " yon tomonning uzunligini kiriting c: ";
    cin >> c;
    cout << " yon tomonning uzunligini kiriting d: ";
    cin >> d;
    double diagonal1 = sqrt(pow(a, 2) + pow(b, 2)); // Birinchi diagonal uzunligi
    double diagonal2 = sqrt(pow(c, 2) + pow(d, 2)); // Ikkinchi diagonal uzunligi
    if (diagonal1 <= c && diagonal2 <= a) { // Agar birinchi diagonal ikkinchi tomonidan kichik yoki teng bo'lsa va ikkinchi diagonal birinchi tomonidan kichik yoki teng bo'lsa
    cout << "The quadrilateral can be inscribed in a circle.\n";
    } else {
    cout << "The quadrilateral cannot be inscribed in a circle.\n";
    }
    return 0;
    }




    double S1, S2;


    cout << "doira maydonini kirting: ";
    cin >> S1;
    cout << "kvadrat maydonini kiriting: ";
    cin >> S2;
    double a = sqrt(S2); // Kvadratning bir tomoni
    double diagonal = sqrt((4 * S1) / M_PI); // Doira uzunligi
    double r = diagonal / 2; // Doiraning radiusi
    if (a <= 2 * r) { // Agar kvadratning har bir tomoni doiraning ichiga sigsa
    cout << "Kvadrat doira ichiga yozilishi mumkin
    .\n";
    } else {
    cout << "Kvadratni aylanaga yozib bo'lmaydi
    .\n";
    }





    #include


    #include
    using namespace std;
    int main() {
    double x1, y1, x2, y2;
    cout << "nuqtaning koordinatalarini kiriting (x1, y1
    ): ";
    cin >> x1 >> y1;
    cout << " nuqtaning koordinatalarini kiritingB (x2, y2): ";
    cin >> x2 >> y2;
    double distanceA = sqrt(pow(x1, 2) + pow(y1, 2)); // distance of point A from the origin
    double distanceB = sqrt(pow(x2, 2) + pow(y2, 2)); // distance of point B from the origin
    if (distanceA > distanceB) {
    cout << "A nuqtasi boshlang'ichdan uzoqroq
    .";
    } else if (distanceB > distanceA) {
    cout << "Point B is farther from the origin.";
    } else {
    cout << "Both points are equidistant from the origin.";
    }




    return 0;
    }

    #include


    #include
    using namespace std;
    int main() {
    double a, b, c;
    cout << "tomonining uzunligini kiriting
    a: ";
    cin >> a;
    cout << " tomonining uzunligini kiriting b: ";
    cin >> b;
    cout << " tomonining uzunligini kiriting c: ";
    cin >> c;
    // check if the sides can form a triangle
    if (a + b > c && a + c > b && b + c > a) {
    double perimeter = a + b + c;
    double s = perimeter / 2; // half of the perimeter
    double area = sqrt(s * (s - a) * (s - b) * (s - c)); // Heron's formula
    cout << "Perimeter of the triangle is: " << perimeter << endl;
    cout << "Area of the triangle is: " << area << endl;
    } else {
    cout << "These sides cannot form a triangle." << endl;




    }
    return 0;
    }
    #include
    #include

    using namespace std;


    int main() {
    int n;
    cout << "o’zgaruvchilar sonini kiriting: ";
    cin >> n;
    vector> A(n, vector(n)); // matrix A
    vector b(n); // vector b
    // input matrix A
    cout << "Enter the elements of matrix A: " << endl;
    for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
    cin >> A[i][j];
    }
    }
    // input vector b
    cout << "Enter the elements of vector b: " << endl;
    for (int i = 0; i < n; i++) {
    cin >> b[i];
    }
    // solve the system of equations using Gauss-Jordan elimination
    for (int i = 0; i < n; i++) {
    // pivot element
    double pivot = A[i][i];
    // divide the current row by the pivot element
    for (int j = i; j < n; j++) {
    A[i][j] /= pivot;
    }
    b[i] /= pivot;

    // eliminate the elements below the pivot element


    for (int k = i + 1; k < n; k++) {
    double factor = A[k][i];
    for (int j = i; j < n; j++) {
    A[k][j] -= factor * A[i][j];
    }
    b[k] -= factor * b[i];
    }
    }
    // back substitution to obtain the solution
    vector x(n);
    for (int i = n - 1; i >= 0; i--) {
    x[i] = b[i];
    for (int j = i + 1; j < n; j++) {
    x[i] -= A[i][j] * x[j];
    }
    }
    // output the solution
    cout << "The solution of the system of equations is: ";
    for (int i = 0; i < n; i++) {
    cout << x[i] << " ";




    }
    cout << endl;

    return 0;


    }

    #include


    using namespace std;
    int main() {
    int age;
    cout << "yoshingizni kiriting: ";
    cin >> age;
    if (age < 7) {
    cout << "siz bolalar bog'chasidasiz." << endl;
    } else if (age >= 7 && age < 18) {
    cout << "siz talabasiz." << endl;
    } else if (age >= 18 && age < 60) {
    cout << "siz ishchisiz." << endl;
    } else {
    cout << "siz pensionersiz." << endl;
    }
    return 0;
    }





    Download 0.71 Mb.




    Download 0.71 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti samarqand filiali kompyuter injiniringi fakulteti

    Download 0.71 Mb.