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

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

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

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

هاااي

شسويتو في الميدتيرم شلون الدرجات :whistling:

​
 
الفاينل لأي جبتر ؟؟:nosweat:​
 
  • Like
التفاعلات: m.g.s

الدرجات كانت اقل مما توقعنا بواجد :whistling:

بس الحمدلله على كل حال ، احسن من غيرنا :rolleyes2:

​

انا الدكتورة نقصتني درجات زيادة على >>> ماحطيت ماينس 1 في الفور + الميدبيتي في سؤال الستراكت بالغلط حطيتها اخر شي مانتبهت و نقصتني 3 درجات عليه ( كل سطر درجة) بروحه كنت بكلمها بس شكلها معصبة و قلت ارضى بدرجتي احسن لي :RpS_blink:

انا كنت متوقع اكثر بس يالله الحمدلله

ان شاء الله في اللاب و الكويزات نعوض
:shiny:​
 
حاولت احلة بس ما عرفت في احد يقدر يساعدني فية
​


  1. [*=center]Consider the following definition of the Struct Phone:
    struct Phone {
    string name;
    int area;
    int number;
    };
    Write a program that do the following:
    [*=center]Write a void value-returning function called DeepCopy that takes two pointers of type Phone and copy the location pointed by the second into the location pointed by the first one.
    [*=center]Write a Boolean value-returning function called DeepCompare that takes two pointers of type Phone and returns true if the structs that they point have identical values in their corresponding fields.
    [*=center]Write a Boolean value-returning function called ShallowCompare that takes two pointers of type Phone and returns true if they point to the same struct and false otherwise.
    [*=center]In the main function:
    [*=center]Declare two pointers Pp1 and Pp2 of type Phone.
    [*=center]Create two dynamic locations that will be pointed by Pp1 and Pp2 .
    [*=center]Store “ Ahmed, 973, and 17454568” respectively into the new location pointed by Pp1.
    [*=center]Copy the values of location pointed by Pp1 into the new location pointed by Pp2(using?).
    [*=center]Check if locations pointed by Pp1 and Pp2 have same values (using?)
    [*=center]Check if Pp1 and Pp2 are pointing to the same location (using?)
    [*=center]Delete the dynamic locations pointed by Pp1 and Pp2.
    [*=center]Declare a pointer variable Phonebook of type Phone.
    [*=center]Create dynamic array of size=10 that will be pointed by Phonebook.
    [*=center]Store “Amina, 973, and 17435833” respectively into element 2 of the dynamic array Phonebook.
    [*=center]Delete the dynamic array Phonebook.
ياليت احد يساعدني

ضروري
​
 
لو عندي برنامج جان سويته بس ماعندي :RpS_ohmy:

من وين آخذه ؟؟

نزلته من المكتب اللي بين اللابات (مبنى السي اس ) >> ذبح الكمبيوتر من الفايروسات و سويت له فورمات

مافي مكان ثاني انزل منه ؟؟
​
 
حاولت احلة بس ما عرفت في احد يقدر يساعدني فية
​

  1. [*=center]Consider the following definition of the Struct Phone:
    struct Phone {
    string name;
    int area;
    int number;
    };
    Write a program that do the following:
    [*=center]Write a void value-returning function called DeepCopy that takes two pointers of type Phone and copy the location pointed by the second into the location pointed by the first one.
    [*=center]Write a Boolean value-returning function called DeepCompare that takes two pointers of type Phone and returns true if the structs that they point have identical values in their corresponding fields.
    [*=center]Write a Boolean value-returning function called ShallowCompare that takes two pointers of type Phone and returns true if they point to the same struct and false otherwise.
    [*=center]In the main function:
    [*=center]Declare two pointers Pp1 and Pp2 of type Phone.
    [*=center]Create two dynamic locations that will be pointed by Pp1 and Pp2 .
    [*=center]Store “ Ahmed, 973, and 17454568” respectively into the new location pointed by Pp1.
    [*=center]Copy the values of location pointed by Pp1 into the new location pointed by Pp2(using?).
    [*=center]Check if locations pointed by Pp1 and Pp2 have same values (using?)
    [*=center]Check if Pp1 and Pp2 are pointing to the same location (using?)
    [*=center]Delete the dynamic locations pointed by Pp1 and Pp2.
    [*=center]Declare a pointer variable Phonebook of type Phone.
    [*=center]Create dynamic array of size=10 that will be pointed by Phonebook.
    [*=center]Store “Amina, 973, and 17435833” respectively into element 2 of the dynamic array Phonebook.
    [*=center]Delete the dynamic array Phonebook.
ياليت احد يساعدني

ضروري
​






وانا بعد ما عرفت احلة ومافهمت منه شي ... ياريت تساعدونا
 
حاول تساعدني فية ,,

دكتور يشرح شيء
والاسايمنتات شيء ثاني
 
ما ادري ,, بالضبظ متى بس

احسة صعب

الدكتور ما عطانا جذي
 
حاولت احلة بس ما عرفت في احد يقدر يساعدني فية
​

  1. [*=center]Consider the following definition of the Struct Phone:
    struct Phone {
    string name;
    int area;
    int number;
    };
    Write a program that do the following:
    [*=center]Write a void value-returning function called DeepCopy that takes two pointers of type Phone and copy the location pointed by the second into the location pointed by the first one.
    [*=center]Write a Boolean value-returning function called DeepCompare that takes two pointers of type Phone and returns true if the structs that they point have identical values in their corresponding fields.
    [*=center]Write a Boolean value-returning function called ShallowCompare that takes two pointers of type Phone and returns true if they point to the same struct and false otherwise.
    [*=center]In the main function:
    [*=center]Declare two pointers Pp1 and Pp2 of type Phone.
    [*=center]Create two dynamic locations that will be pointed by Pp1 and Pp2 .
    [*=center]Store “ Ahmed, 973, and 17454568” respectively into the new location pointed by Pp1.
    [*=center]Copy the values of location pointed by Pp1 into the new location pointed by Pp2(using?).
    [*=center]Check if locations pointed by Pp1 and Pp2 have same values (using?)
    [*=center]Check if Pp1 and Pp2 are pointing to the same location (using?)
    [*=center]Delete the dynamic locations pointed by Pp1 and Pp2.
    [*=center]Declare a pointer variable Phonebook of type Phone.
    [*=center]Create dynamic array of size=10 that will be pointed by Phonebook.
    [*=center]Store “Amina, 973, and 17435833” respectively into element 2 of the dynamic array Phonebook.
    [*=center]Delete the dynamic array Phonebook.
ياليت احد يساعدني

ضروري
​

اخوي جوف هالحل مادري صح او لا من 1 الى 3
لأن ماعطونه ستراكت بس الكلاس من جذي مادري اذا صح او لا :nosweat:

HTML:
#include<iostream>
Using namespace std;
struct phone {
string name;
int area;
int number;
};
void DeepCopy (phone *x, phone *y){
x.area=y.area;
}
bool DeepCompare(phone *p1, phone *p2){
return( p1.name==p2.name && p1.area==p2.area  && p1.number==p2.number);
}
 
التعديل الأخير:
حاولت احلة بس ما عرفت في احد يقدر يساعدني فية
​

  1. [*=center]Consider the following definition of the Struct Phone:
    struct Phone {
    string name;
    int area;
    int number;
    };
    Write a program that do the following:
    [*=center]Write a void value-returning function called DeepCopy that takes two pointers of type Phone and copy the location pointed by the second into the location pointed by the first one.
    [*=center]Write a Boolean value-returning function called DeepCompare that takes two pointers of type Phone and returns true if the structs that they point have identical values in their corresponding fields.
    [*=center]Write a Boolean value-returning function called ShallowCompare that takes two pointers of type Phone and returns true if they point to the same struct and false otherwise.
    [*=center]In the main function:
    [*=center]Declare two pointers Pp1 and Pp2 of type Phone.
    [*=center]Create two dynamic locations that will be pointed by Pp1 and Pp2 .
    [*=center]Store “ Ahmed, 973, and 17454568” respectively into the new location pointed by Pp1.
    [*=center]Copy the values of location pointed by Pp1 into the new location pointed by Pp2(using?).
    [*=center]Check if locations pointed by Pp1 and Pp2 have same values (using?)
    [*=center]Check if Pp1 and Pp2 are pointing to the same location (using?)
    [*=center]Delete the dynamic locations pointed by Pp1 and Pp2.
    [*=center]Declare a pointer variable Phonebook of type Phone.
    [*=center]Create dynamic array of size=10 that will be pointed by Phonebook.
    [*=center]Store “Amina, 973, and 17435833” respectively into element 2 of the dynamic array Phonebook.
    [*=center]Delete the dynamic array Phonebook.
ياليت احد يساعدني

ضروري
​

انا سويت جذي

سوري اذا ماشتغل لان ماعرف للستراكت بس حاولت
:whistling:

HTML:
     #include<iostream>
Using namespace std;
struct phone {
string name;
int area;
int number;
};
void DeepCopy (phone *x, phone *y){
x.area=y.area;
}
bool DeepCompare(phone *p1, phone *p2){
return( p1.name==p2.name && p1.area==p2.area  && p1.number==p2.number);
}
bool ShallowCompare(phone *p1, phone *p2){
return( p1.name==p2.name && p1.area==p2.area  && p1.number==p2.number);
}
void main(){
phone *Pp1;
phone *Pp2;
Pp1=new phone;
Pp2=new phone;
Pp1->name="ahmed";
Pp1->area=973;
Pp1->number= 17454568;
DeepCopy (*Pp1, *Pp2);
DeepCompare(*Pp1,*Pp2);
ShallowCompare(*Pp1, *Pp2);
delete Pp1;
delete Pp2;
phone *phonebook;
phonebook=new phone[10];
for(int i=0;i<10;i++)
{ if(i==2)
{  Phonbook[i]->name="amina";
Phonebook[i]->area=973;
Phonebook[i]->number= 17435833;
  }
}
delete []phonebook;
 }

اتمنى من الاخ the unknown يساعدكم :nosweat:​
 
Write a void value-returning function called DeepCopy that takes two pointers of type Phone and copy the location pointed by the second into the location pointed by the first one.
Write a Boolean value-returning function called DeepCompare that takes two pointers of type Phone and returns true if the structs that they point have identical values in their corresponding fields.
Write a Boolean value-returning function called ShallowCompare that takes two pointers of type Phone and returns true if they point to the same struct and false otherwise.

فنكشن
deepCopy بتسوي كوبي الى اللوكيشن اللي ياشر عليه البونتر نفسه
ااذا سوينا جدي p = q هذا نسميه shallow
والديب بيكون جدي p = new phone; وعقب اسوي كوبي الى الفيمه اللي داخل q بتصير جدي *p = *q;

فنكشن الثانيه deepCompare تجيك القيم اللي داخل البونتر اذا متشابهين او لا p->name == q->name ومثلا الشي الى الباقي

الفنكشن الثالثه تجيك البونتر نفسه اذا كان ياشر على نفس المكان او لا if(p== q ) بس
 
  • Like
التفاعلات: m.g.s
فنكشن
deepCopy بتسوي كوبي الى اللوكيشن اللي ياشر عليه البونتر نفسه
ااذا سوينا جدي p = q هذا نسميه shallow
والديب بيكون جدي p = new phone; وعقب اسوي كوبي الى الفيمه اللي داخل q بتصير جدي *p = *q;

فنكشن الثانيه deepCompare تجيك القيم اللي داخل البونتر اذا متشابهين او لا p->name == q->name ومثلا الشي الى الباقي

الفنكشن الثالثه تجيك البونتر نفسه اذا كان ياشر على نفس المكان او لا if(p== q ) بس

مشكوووور اخوي بيرات
لان متعودين على الكلاس و ماعطونه امثلة على ستراكت
:smile2:​
 
عندي اسايمنت الحمدلله سويته والبرنامج مايقول ان في خلل بالكود .. بس لما اسوي ديبق !!
يعطيني هالايرور ..

Invalid allocation size: 4294967295 bytes

بالنت مكتوب عن سالفة -1 مادري ويش وصراحة مافهمت !!
احد يعرف ويش المشكلة .. ؟
​
 
عندي اسايمنت الحمدلله سويته والبرنامج مايقول ان في خلل بالكود .. بس لما اسوي ديبق !!
يعطيني هالايرور ..

Invalid allocation size: 4294967295 bytes

بالنت مكتوب عن سالفة -1 مادري ويش وصراحة مافهمت !!
احد يعرف ويش المشكلة .. ؟
​

حطي الكود :RpS_unsure:
 
اكوهااا :smile2:

كود:
#include<iostream>
#include<string>
using namespace std;
class shoppingList {
private: 
    string *list ;
    int maxSize ;
    int numItems ; 
public: 
    shoppingList ( ) ;
    ~shoppingList ( ) ;
    shoppingList ( const shoppingList & ) ;
    void printList () ;
    void addNewItem (string) ;
};

shoppingList::shoppingList ( )
{
    maxSize=10;
    list = new string [maxSize];
    numItems = 0 ;
}
shoppingList::~shoppingList ()
{
    cout << "All data delete " ;
    delete [] list ;
    list = 0 ;
}
shoppingList::shoppingList ( const shoppingList & A ) 
{
    numItems= A.numItems ;
    string * p ;
    p = new string [maxSize] ;
    for ( int i = 0 ; i< A.numItems ; i ++ )
        list[i] = A.list[i] ;
}
void shoppingList::addNewItem (string y)
{
    if ( maxSize > numItems )
    {
        list[numItems] = y ;
        numItems ++ ;
    }

}
void shoppingList::printList ()
{
    cout << " all the information about shoppingList : " << endl ; 
    cout << " maxSize : " << maxSize << endl ;
    cout << " numItems : " << numItems << endl ;
    cout << " information of Array : " << endl ;
    for ( int i = 0 ; i < numItems ; i ++ )
        cout << list[i] << endl;
}

int main()
{
    shoppingList firstList;
     firstList.addNewItem("Rice") ;
     firstList.addNewItem("Sugar") ;
     shoppingList secondList (firstList) ;
     firstList.printList () ;
     secondList.printList () ;

     return 0 ; 

}
 
التعديل الأخير:
اكوهااا :smile2:

كود:
#include<iostream>
#include<string>
using namespace std;
class shoppingList {
private: 
    string *list ;
    int maxSize ;
    int numItems ; 
public: 
    shoppingList ( ) ;
    ~shoppingList ( ) ;
    shoppingList ( const shoppingList & ) ;
    void printList () ;
    void addNewItem (string) ;
};

shoppingList::shoppingList ( )
{
    maxSize=10;
    list = new string [maxSize];
    numItems = 0 ;
}
shoppingList::~shoppingList ()
{
    cout << "All data delete " ;
    delete [] list ;
    list = NULL ;
}
shoppingList::shoppingList ( const shoppingList & A ) 
{
    numItems= A.numItems ;
    string * p ;
    p = new string [maxSize] ;
    for ( int i = 0 ; i< A.numItems ; i ++ )
        list[i] = A.list[i] ;
}
void shoppingList::addNewItem (string y)
{
    if ( maxSize > numItems )
    {
        list[numItems] = y ;
        numItems ++ ;
    }

}
void shoppingList::printList ()
{
    cout << " all the information about shoppingList : " << endl ; 
    cout << " maxSize : " << maxSize << endl ;
    cout << " numItems : " << numItems << endl ;
    cout << " information of Array : " << endl ;
    for ( int i = 0 ; i < numItems ; i ++ )
        cout << list[i] << endl;
}

int main()
{
    shoppingList firstList;
     firstList.addNewItem("Rice") ;
     firstList.addNewItem("Sugar") ;
     shoppingList secondList (firstList) ;
     firstList.printList () ;
     secondList.printList () ;

     return 0 ; 

}



نفس الي سويناه باللاب .. واي مايشتغل ..

بس كأن انتينا مسويه اشياء زياده على الي سويته في هالفنكشن
.. مادري هم صح او غلط .. لأن يعتمد على اسلوبش بالحل ..

كود:
[COLOR=#000000][B][FONT=tahoma][SIZE=2]

shoppingList::shoppingList ( const shoppingList & A ) [/SIZE][/FONT][/B][/COLOR]
 
نفس الي سويناه باللاب .. واي مايشتغل ..

بس كأن انتينا مسويه اشياء زياده على الي سويته في هالفنكشن
.. مادري هم صح او غلط .. لأن يعتمد على اسلوبش بالحل ..

كود:
[COLOR=#000000][FONT=tahoma][SIZE=2]

shoppingList::shoppingList ( const shoppingList & A ) [/SIZE][/FONT][/COLOR]


اهااااا مشكورة خيه :smile2:

​
 
عودة
أعلى أسفل