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

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

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

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

خساره ما ادري قمت سيدا طرشته بس برد اعدله و بطرشه ما كنت ادري
لمتى التسليم؟؟
اوكي
ابتديتون الدوره الجديده في المعهد؟؟

:thumbdown: راحت عليي نومة اليوم و ما رحت

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

اعتقد الاسبوع الجاي بنبتدي الدورة الجديدة :confused:
 
السلااااااااااااااااااااااام علييييييييييييييييكم

والله انا عند دكتور رمزي وعطانه اسايمنت !! اهو سهل بس مب عارفه شلون اسوي الكوبي !

Write a function named from_1_to_2 that takes as parameters pointer to one dimension array, pointer to two dimensional array, the size of the one-dimensional array, and the row size of the two dimensional array where the number of rows is equal to the number of column. The function should store the content of the one-dimensional array in the two dimensional array as shown in the example below using dynamic two dimensional array. The prototype of the function is:
void from_1_to_2(int * array1d ,int ** array2d, int array1dsize, int array2dsize)

!!
ياريييييت حد يعلمني شلون اسوي الكووبي !!ومشكوووووووووين
 
اختي اسايمنتكم جزء من الأسايمنت مالنا

روحي الصفحة الي قبلها وجوفي الشرح للجزء الثاني من الأسامينت مالنا

و اذا ما فهمتين نرد نعيده لش
 
مشكووووووووووورة فديتج !! بس مافهمت الاسايمنت مالكم !! تخربطت
 
مشكووووووووووورة فديتج !! بس مافهمت الاسايمنت مالكم !! تخربطت

:nosweat: احنا اسايمنتنا فيه فنكشن زيادة مع المين زيادة على الأسايمنت مالكم

جوفي الي كتبته عن الفنكشن الثانية هي نفسها الأسامينت مالكم:smile:
 
السلااااااااااااااااااااااام علييييييييييييييييكم

والله انا عند دكتور رمزي وعطانه اسايمنت !! اهو سهل بس مب عارفه شلون اسوي الكوبي !

Write a function named from_1_to_2 that takes as parameters pointer to one dimension array, pointer to two dimensional array, the size of the one-dimensional array, and the row size of the two dimensional array where the number of rows is equal to the number of column. The function should store the content of the one-dimensional array in the two dimensional array as shown in the example below using dynamic two dimensional array. The prototype of the function is:
void from_1_to_2(int * array1d ,int ** array2d, int array1dsize, int array2dsize)

!!
ياريييييت حد يعلمني شلون اسوي الكووبي !!ومشكوووووووووين

 
PART A
Write a function named twomax that takes a pointer to an array of integer numbers, array size, a pointer to integer which is the index of the first maximum, and another pointer to integer which is the index of the second maximum as parameters. The function should find and return the index (subscript or position) of the first maximum element and the index of the second maximum element in the array of integers. The function prototype is:
void twomax (int *arr, int size, int *p1, int *p2);

Example: If the array contains:


6 55 60 50 3 40


The index of the first maximum is 2, and of the second maximum is 1



PART B

In the main function:
1. Declare an array of integers and store in it some elements.
2. Call the function twomax.
3. Output the array.
4. Output the index of the first maximum element and the index of the second maximum element in the array
.

ممكن احد يقلي شنو المقصدود بالبارت الاول
​
 
PART A
Write a function named twomax that takes a pointer to an array of integer numbers, array size, a pointer to integer which is the index of the first maximum, and another pointer to integer which is the index of the second maximum as parameters. The function should find and return the index (subscript or position) of the first maximum element and the index of the second maximum element in the array of integers. The function prototype is:
void twomax (int *arr, int size, int *p1, int *p2);

Example: If the array contains:


6 55 60 50 3 40


The index of the first maximum is 2, and of the second maximum is 1



PART B

In the main function:
1. Declare an array of integers and store in it some elements.
2. Call the function twomax.
3. Output the array.
4. Output the index of the first maximum element and the index of the second maximum element in the array
.

ممكن احد يقلي شنو المقصدود بالبارت الاول
​

لو من دون Pointer
يبون الـ function تاخذ array
و size
و 2 integers
و الفنكشن تجوف لينا أكبر اثنين في الـ array
و ترجع مواقعهم,,
بالـ pointer

الفرق ان نغير قيمة الـ variable اللي يأشر عليه الـ pointer
يعني

PHP:
*p1=i;

و الـ array عبارة عن dynamic array
يعني نسويه بالـ new​
 
لو من دون Pointer
يبون الـ function تاخذ array
و size
و 2 integers
و الفنكشن تجوف لينا أكبر اثنين في الـ array
و ترجع مواقعهم,,
بالـ pointer

الفرق ان نغير قيمة الـ variable اللي يأشر عليه الـ pointer
يعني

PHP:
*p1=i;
و الـ array عبارة عن dynamic array
يعني نسويه بالـ new​
اي اخوي فهمت قصدك :nosweat:
انا الحين بحاول اسويه وبنزل الحل باذن الله :icon30:
يا ريت تشكلي اياه
:showoff:
ومشكور وايد ما قصرت :nosweat:
​
 
يعطيكم العافية

سيد حسين اني براويك اللي سويته ابي اعرف هو صح او خطأ لان ما عندي الكومبايلر:nosweat:
اطرشه في رسالة خاصة؟؟
​
 
ممكن احد يشرح لنا overloading
 
ممكن احد يشرح لنا overloading
 
Write a function named twomax that takes a pointer to an array of integer numbers, array size, a pointer to integer which is the index of the first maximum, and another pointer to integer which is the index of the second maximum as parameters. The function should find and return the index (subscript or position) of the first maximum element and the index of the second maximum element in the array of integers. The function prototype is:
void twomax (int *arr, int size, int *p1, int *p2);

Example: If the array contains:

6 55 60 50 3 40

The index of the first maximum is 2, and of the second maximum is 1


حليت الفنكشن ابي اكتب المين ماعرف ارتبه عدل :$ من يعلمني
 
^^
المين فيه هالأشياء

تعريف البوينترس,
int * arr;
int * ptr1;
int * ptr2;
int size;

نسوي dynamic variables
arr=new int[size];
ptr1=new int;
ptr2=new int;

و نسوي call للفنكشن,
و cout للقيم اللي رجعتهم لينا الفنكشن
و لا تنسين الـ delete​
 
السلام عليكم
شخبار شباب
:smile:
انا حليت الاسايمنت بس مو راضي يصير كومبايلر :anger2يمكن عشان بعض الاخطاء :bleh:
احطه هني اذا احد يقدر يعدلليي:nosweat:
:bye1:
السوال في المرفق:surrender:
 

المرفقات

التعديل الأخير:
^^
المين فيه هالأشياء

تعريف البوينترس,
int * arr;
int * ptr1;
int * ptr2;
int size;

نسوي dynamic variables
arr=new int[size];
ptr1=new int;
ptr2=new int;

و نسوي call للفنكشن,
و cout للقيم اللي رجعتهم لينا الفنكشن
و لا تنسين الـ delete​


مشكوور اخوي
 
قوووة

عندي خلل بسيط في البرنامج

في الاوت بوت ماتطلع الارقام يطلع ليي الادرس في الاري الاولى ولما اسوي الكوي بعد

شلون اخلي الارقام تطلع مو الادرس؟؟
 
^^
المين فيه هالأشياء

تعريف البوينترس,
int * arr;
int * ptr1;
int * ptr2;
int size;

نسوي dynamic variables
arr=new int[size];
ptr1=new int;
ptr2=new int;

و نسوي call للفنكشن,
و cout للقيم اللي رجعتهم لينا الفنكشن
و لا تنسين الـ delete​


ليش الدليت خووي
بس انسوي انه الاري مال maximum الاولى بتساوي NULL وخلاص
لو لا؟



روح الامل
 
شرح بسيط للoverloading ان شاء الله تفهمون منه شي :rolleyes2:

في نوعين من overloading

1- operator function

2- friend function

* operator function

يعني مثلا عدنا class اسمه rectangle و سوينا في المين 3 objects

r1,r2 ,r3

و قلنا

كود:
r3=r1+r2

ما بنقدر نسوي آد للأوبجكتس لأنهم كلاس و كل واحد فيه length and width

فنسوي فنكشن فيها عملية ال+ عشان اذا كتبنا هالكود يصير كول للفنكشن

اول شي الصيغة العامة لكتابة اي فنكشن للأوفر لودنغ

كود:
returntype  operator theoperator (const classname & ) const

1- theoperator اقصد منها علامة العملية مثلا + , - , / , *

بنكتب الحين الفنكشن مالت الركتانقل بس برى الكلاس على انها ممبر فنكشن

كود:
rectangle rectangle :: operator + (const rectangle & rr) const 
{
rectangle rrr ; 
rrr.length = length + rr.length ; 
rrr.width=width+rr.width ; 
return rrr ; 
}

في الأوبيريتر فنكشن دائما نطرش باراميتر واحد بس و نسوي داخل الفنكشن

اوبجكت جديد عشان نرجعه كنتيجة للجمع

و نتعامل في الجمع مع الفاريبل الأصلي الي في الكلاس و الفاريبل مال الكلاس الي

طرشناها و هني افترضنا ان عدنا كلاس اسمها rectangle و داخلها 2 فاريبلز

width and length :smile:

* friend function

نفس الشي مع فروق بسيطة

1- الoperator function تنحط في الكلاس تحت الpublic
اما الfriend function تنحط في الكلاس قبل الprivate

2- ال operator function نطرش ليها باراميتر واحد بس اما الفرند فنكشن نطرش ليها 2

و اذا بنكتبها برى الكلاس ما نحط كلمة friend

3- اذا بتكتب البروتوتايب مالها في الكلاس بكون بهالنمط

كود:
friend returntype operator theoperator (const classname & , const classname & )

اذا سويناها على نفس مثالنا القبلي بس non member function

كود:
rectangle operator + (const rectangle &r1 , const rectangle &r2)
{
rectangle r3 ; 
r3.length=r1.length+r2.length ; 
r3.width = r1.width +r2.width ; 
return r3 ; 
}

نفس الشي بس هني ما نتعامل مع الفاريبلز مال الكلاس :smile:

في طريقة ثانية بعد ان بدال ما نكتب اوبيريتر و نحط العملية نكتب كلمة مثلا add

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

كود:
rectangle r1,r2,r3 ; 
r3=add(r1,r3 ) ;

:showoff: ان شاء الله كل شي يكون مفهوم
 
عودة
أعلى أسفل