Ali Hassan
اا مشرف سابق اا
- تاريخ التسجيل
- 30 سبتمبر 2011
- المشاركات
- 7,379
- المجموعة
- ذكر
- الدفعة الدراسية
- معلومة خاصة
- التخصص
- 0
إلى آخر درس في الـ class او ما بعد الأخير من الـ classالسلام عليكم ..
الامتحان بيكون لي وين بالضبط ؟؟؟؟؟؟؟
إلى آخر درس في الـ class او ما بعد الأخير من الـ classالسلام عليكم ..
الامتحان بيكون لي وين بالضبط ؟؟؟؟؟؟؟
سلام عليكم ..
عندي سؤالين ::
1- شلون نسوي selection sort اذا نبي ال maxindex ??
2- اذا طلبو منه نسوي insert for item :
shift to rigth عادي تكون خارج الفنكشن أو داخلها ؟؟
يعني يصير نسوي فنكشن بروحها للشفت تو رايت تالي نسوي كول .. أو نخلي شفت تو رايت داخل فنكشن الانسيرت ؟؟

اهاا .. طييبب شكراا ..![]()

عندي سؤال حق الsubstr من وين انبدي العد و شلون؟ و يصير تعطوني جم من مثال عشان افهم لاني متخربطة
string str="My name is hussain";
cout<<str.substr(0,7)<<endl;
cout<<str.substr(3)<<endl;
void insertSum ( int arr[] , int &length , int size ) { while ( lenght < = size ) { for ( int i=0 ; i<lenght ; i++) if ( arr[i]+arr[i+1]<arr[i+2] ) { for ( int j=length ; j > i+1 ; j-- ) arr[j]=arr[j-1]; arr[i+2] = arr[i]+arr[i+1] ; length ++ ; } }
}

[ PART A: 8 Points]
Write a function named generateNewEmail which takes string (email) as a paramater, where
email represents an email address. The function should extract the user name from email and
return a new email for the user on “uob.edu.bh” domain.
Solve this question by using the functions defined in <string> library, such as: length,
substr, size, swap, and find.
For example,
If email = [email protected], the function should return: [email protected]
string generateNewEmail (string email)
{
int index=email.find('@');
string userName= email.substr(0, index );
userName = userName + "@uob.edu.bh";
return userName;
}
userName = userName + "uob.edu.bh";
s2al basee6
كود:[ PART A: 8 Points] Write a function named generateNewEmail which takes string (email) as a paramater, where email represents an email address. The function should extract the user name from email and return a new email for the user on “uob.edu.bh” domain. Solve this question by using the functions defined in <string> library, such as: length, substr, size, swap, and find. For example, If email = [email protected], the function should return: [email protected] string generateNewEmail (string email) { int index=email.find('@'); string userName= email.substr(0, index ); userName = userName + "@uob.edu.bh"; return userName; }
mb mafroo6' ena e9eer
كود:userName = userName + "uob.edu.bh";
bdoon el @ l2na ehya already mawjooda lama est5damna el substr
etha 7sbtooha fee el methal UserA el index e9eer 6 fa el @ included l2nha position malha 6

سلام شباب .. في الكلاس
ممكن شرح لانواع الكونستراكتور ؟
متى نعرف ان الفنكشن كونستانت ؟
-
السلام عليكم
عندي سؤال بس ابي اعرف اذا حلي صح او لا ؟
Write a function named insertSum that takes as parameters: an array of integers, number of elements
in the array which is passed by reference, and a constant array size. The function should insert the
sum of two consecutive elements in the array if the value of the sum is less than the value of the
element after the consecutive elements when there is a place in the array to insert new element.
The function prototype is: void insertSum(int arr[], int & length, const int SIZE);
For example, if the following array arr with length 10 and SIZE 15:
0 1 2 3 4 5 6 7 8 9
2 5 20 21 30 35 80 86 110 270
is called then the new values in the arr are
2 5 7 20 21 30 35 65 80 86 110 196 270
. . .
v
هلون حلي :
HTML:void insertSum ( int arr[] , int &length , int size ) { while ( lenght < = size ) { for ( int i=0 ; i<lenght ; i++) if ( arr[i]+arr[i+1]<arr[i+2] ) { for ( int j=length ; j > i+1 ; j-- ) arr[j]=arr[j-1]; arr[i+2] = arr[i]+arr[i+1] ; length ++ ; } } }
![]()

void insertSum ( int arr[] , int &length , int size )
{
int i=0;
while( i<length)
{
if (arr[i]+arr[i+1]<arr[i+2] && length+1<=size)
{
for ( int j=length-1 ; j>=i+2 ; j-- )
arr[j+1]=arr[j];
arr[i+2]=arr[i]+arr[i+1];
length ++ ;
i+=2;
}
else
i++;
}
}
سكشن 5 وينن الامتحان ؟؟؟ دكتورة نادية

index=5 لأن يبدي من 0![]()