موقع طلبة جامعة البحرين

يمكنك تصفح الموقع كزائر ولكن ندعوك لتسجيل عضوية خاصة بك لتحصل على كافة الصلاحيات مثل تنزيل ملفات المكتبة وقراءة تعليقات هيئة التدريس وغيرها. يمكنك الحصول على عضوية مجانية بالضغط على زر تسجيل. إذا قمت بالتسجيل مسبقا فيمكنك الضغط على زر دخول.

تسجيل دخول
  • قسم المكتبة الجامعية مغلق مؤقتا بعد الاستهداف التي تعرضت له بعض خدمات أمازون في البحرين، جاري استرجاع الملفات ونقلها إلى سيرفرات جديدة وسيتم بعدها اعادة افتتاح المكتبة

ITCS112 - ITCS104 - ITCS102 للفصل الصيفي 2014 - 2015

شسويتو في السي اس 104:whistling:

بشرووو
:shiny:

مشكووورة دكتورة نادية دمير
:RpS_love:​
 
:RpS_tongue: مادري ليش متهيأ ليي انك اول واحد تشكرها

:smile2: الف مبروووك
 
هذا الموضوع لأجل الدراسة الجماعية لمقرر ITCS102 - ITCS104

أدرس المقرر سكشن 8 مع الدكتورة نهلة المرزوقي

..
..

~ Good Luck ~


:smile:

​
 
ادرس هالمقرر عند د.أمل غانم
سكشن 06
 
لحد الآن أحس المقرر مثل 103

مهم نرجع على الفنكشن و الأري
​
 
لحد الآن أحس المقرر مثل 103

مهم نرجع على الفنكشن و الأري
​

:shiny: بما ان هو تكملة لل103 یعنی C++ فبتحتاجون كل شي اخذتونه

من الجبتر الثاني بتاخذون اشياء جديدة عشان تسوون برامج اكبر

:smile2: بالتوفيق
 
سكشن 6
دكتورة أمل ..

شرايكم فيها ، زينة أو لا؟؟
 
سكشن 6
دكتورة أمل ..

شرايكم فيها ، زينة أو لا؟؟

دكتورة ممتازه من كل النواحي
تشرح لش البرنامج بالتفصيل
و سمعت انها افضل دكتورة حق هالمقرر
 
احد يعرف لو يذكر فكشنات مالت كونستركتر وذا بارتيمنت -ووذ اوت -بارتيمنت والديفلوت


<< هم ثلاث وحدات مال 104 بس نسيتهم امبيه اذا ما عليكم امر
 
Assignment #1
sec 8

13306816662.jpg
 
نهلة02

اي قالت لازم الي مو فاهم يرجع لي الجبتر 6/7
 
ياريت مساعدة في اسايمنت cs102

هذا الاسايمنت
LAB1-2 Chap10

  1. Write a function, removeAt, that takes three parameters: an array of integers, the number of elements in the array, and an integer (say, index). The function should delete the array element indicated by index. If index is out of range or the array is empty, output an appropriate message.
  1. Write a function, removeAll, that takes three parameters: an array of integers, the number of elements in the array, and an integer (say, Item). The function should find and delete all of the occurrences of Item in the array.
NOTE: Use function removeAt in the function removeAll.
  1. Write a main function to test your functions

وهذا حلي
#include
<iostream>


using namespace std;


void removeat(int list[],int &leanght,int index)

{


if(leanght==0)

{

cout<<
"the array its empty";

}



else if (index<0 || index>leanght)

cout<<
"not in rang";






for (int j=index;j<leanght;j++)

list[j]=list[j+1];

leanght--;

}







void removeall(int list[],int &leanght,int item)

{


int loc;


for(int i=0;i<leanght;i++)


if(list==item)

loc=removeat( list,leanght, i);

}


int main();

{


int pos;


int leanght=8;


int list[8]={2,3,5,5,5,4,8,9};


int item;

cout<<list[8];

cout<<
"enter item";

cin>>item;

pos=removeall( list,leanght, item)


return 0;

}


طبعاً متروس ايرورز
ومو عارفة اضبطه

ياريت احصل مساعدة في ضبطه:blushing:
 
ممكن شرح لأنوع الـsearch ...
الـBinary Search و الـsequential ..
هل في الـ Binary Search و الـsequential نبحث عن الKey ؟؟
 
بليز يعني الي يعرف يرد

اني ماقلت حلوه ليي و اخذ حلكم على الجاهز

اني حالة وامبا اعرف وش اخطائي
 
check this code

كود:
#include <iostream>
using namespace std;

void RemoveAt(int arr[],int length,int index)
{
    if(length < 0)
        cout<< "this array is empty";
    else
        if(index < 0 || index > length)
            cout<< "the index is out of range";
        else
        {
            for(int i=index; i<length ;i++)
            {
                arr[i]=arr[i+1];
            }
            arr[length-1]=0;
        }
        
    //This for loop will show you the values of the array after deleting the element "RemoveAt"
    cout << "\n\n" << "Elements after deleting"<<"\n";
    for (int i = 0; i < length ; i++)
    {
        cout << arr[i]<<"\n";
    }

}

void RemoveAll(int arr[],int length,int item)
{
    if(length < 0)
        cout<< "this array is empty";

    else
    {
        for (int i=0;i<length;i++)
        {
            if(arr[i]==item)
                {
                    RemoveAt(arr,10,i);
                    i=i-1;
            }
        }
    }

    cout << "\n\n" << "Elements after deleting"<<"\n";
    for (int i = 0; i < length ; i++)
    {
        cout << arr[i]<<"\n";
    }
    cin.get();
}


int main ()
{
    int myArray [10] = {0,1,2,3,4,5,6,7,8,9};
    int myArray2 [10] = {1,1,2,2,2,3,4,5,5,6};
    int index,item,choice;

    cout << "If you want to delete index press 1 \nIf you want to delete item press 2 \nChoice: ";
    cin>>choice;

    if(choice == 1)
    {
        cout<< "\n\n"<<"enter the index\nIndex: ";
        cin>>index;

        //This for loop will show you the values of the array before deleting the element "RemoveAt"
        cout << "Elements before deleting"<<"\n";
        for (int i = 0; i < 10 ; i++)
        {
            cout << myArray[i]<<"\n";
        }

        RemoveAt(myArray,10,index);
        cin.get();
    }
    else
    {
        cout<< "\n\n"<<"enter the item\nItem: ";
        cin>>item;
        
        
        //This for loop will show you the values of the array before deleting the element "RemoveAll"
        cout << "Elements before deleting 'this is the second array'"<<"\n";
        for (int i = 0; i < 10 ; i++)
        {
            cout << myArray2[i]<<"\n";
        }


        RemoveAll(myArray2,10,item);
    }
    cin.get();
    return 0;
}
 
التعديل الأخير:
عودة
أعلى أسفل