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

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

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

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

شكرا جزيلاا نخدمك في الافراح
 
ممكن حل توتريال Overloaading And Templates
باجر عندي لانه كويز


اي ماعليكم امر نبي الحل ويااااااريت الا فاهمه يشرحه لأني كنت غاايبة ..

والا قدم اليوم الاختبار يقول لنا السسؤال ..

بكرة اختباري

بالانتظاااااااار
 
الله يستر من هالدكتوور ,, يقوول كل محاضرة اختبار :RpS_crying:
 
ممكن مساعتكم
يبين سهل بس ما عرفت احله

write a function named compareArrays that takes 4 parameters, two arrays of any type

(arrA[] and arrB[]) , and two integers sizeA and sizeB, being the number of elements in the two arrays respectively. The function should return boolean value which is true if the arrays are of the same size and all the corresponding elements in both arrays arrA and arrB are equal. Otherwise, it will return false. (i.e. return false if sizeA is different from sizeB or if any element of arrA is different from the corresponding element of arrB). Test the functions by writing a C++ program
 
محد عنده حل التورتايل مال التمبلت والافورلودينق ؟؟
 
شباب ممكن مساعد في الاوفر لودينج
اذا عندك
friend bool operator ==(const matrix &, const matrix &);
وكتبت ليه الكودات :
template <class m>
bool operator==(const matrix & f, const matrix & s){
..........................................
......................................
............................................... }
شلون استدعيه في الماين (main )
قصدي شلون اعمل المقارنة
اذا كتبت مثلا :
if (anything == anything2)
يعطيك error
 
ممكن مساعتكم
يبين سهل بس ما عرفت احله

write a function named compareArrays that takes 4 parameters, two arrays of any type

(arrA[] and arrB[]) , and two integers sizeA and sizeB, being the number of elements in the two arrays respectively. The function should return boolean value which is true if the arrays are of the same size and all the corresponding elements in both arrays arrA and arrB are equal. Otherwise, it will return false. (i.e. return false if sizeA is different from sizeB or if any element of arrA is different from the corresponding element of arrB). Test the functions by writing a C++ program

اني بعد ما عرفت مع انه سهل .. :RpS_glare:
ابي توضييح ليه
 
حليته بروحي بس المين خليت الدكتور يساعدني اكتشفت ان المين مايصير نسوي فيها تمبليت

..

هذا سؤالي الثاني

Write a recursive function CountOddNumbers that counts the odd numbers in an array and returns it to the main program. The function accepts as parameters an array of integer numbers, the array size.
Test the function by writing a C++ program.


PHP:
#include<iostream>
using namespace std;
int CountOddNumbers(int size,int arr[])
{
int sum=0;
{
if(size==0)
return 0;
}
{
else if (arr[size]%2!=0)
return (arr[size]/10);
sum+=CountOddNumbers(arr[size]/10);
}
}
void main()
{
cout<<CountOddNumbers(12345);
}
 
انه للحين مو فاهم ليه Recursion
احسه معقد عدل...
 
ممكن مساعتكم
يبين سهل بس ما عرفت احله

write a function named compareArrays that takes 4 parameters, two arrays of any type

(arrA[] and arrB[]) , and two integers sizeA and sizeB, being the number of elements in the two arrays respectively. The function should return boolean value which is true if the arrays are of the same size and all the corresponding elements in both arrays arrA and arrB are equal. Otherwise, it will return false. (i.e. return false if sizeA is different from sizeB or if any element of arrA is different from the corresponding element of arrB). Test the functions by writing a C++ program

اهني تسوون تمبلت .. حق الفنكشن .. الي هي ترجع boolean ... طبعا داخل الفنكشن داينمك أرري ..الفنكشن المفروض ترجع ترو اذا كان الارري أي وارري بي اللي داخلها يساوون بعض في السايز و بعد اذا يتشابهون في العناصر اللي داخلهم .. واذا غير جذي ترجع فولس ..

عقب تسوون المين

عشان تختبرون الفنكشن ..
 
انه للحين مو فاهم ليه Recursion
احسه معقد عدل...

يعني هو مو معقد معقد

بس يحتاج براكتس

نوع الا اتفق وياك

إذا الا حليتها صح يعني اني فهمت الفكره عدل وإذا كودي كلش غلط يعني كلنا في الهواء سوا

هو نوع السهل ونوع الصعب مادري
 
ههههههه اهو سهل بس المشكله مادري من وين اراجع
فتحت الكتاب فيه اشياء غريبه كانه مو مطلوبين علينا لا ؟
 
سيد حسين
ممكن تشرح لينا اخر جبترين :blushing:
 
يشرح اهني سيد حسين؟؟
 
write a program that defines an array studentlist of pointer to struct
student .The program should ask the user to enter student dynmically and add
it to the array studentlist . the program should ask the user to enter num1
and num2 then the program should print the ids of all student thar are
between num1 and num2.the maximam number of student is 100

هذا كودي

بغيت مساعده

PHP:
#include<iostream>
using namespace std;
struct student
{
int id;
float mark;
int*studentlist;
}
void main()
{
student m;
student*ptr;
int first,lest;
student studentlist[100];
//ptr=new student studentlist[100];
m=new student studentlist[100];
{
//if ((*ptr).id==-1)
//or if(m.id==-1)
cout<<"should be stop the program";
cout<<"enter the first name and lest name";
cin>>first>>lest;
if ((*ptr).id>=first&&(*ptr).id<=lest){
cout<<"enter of id and mark"<<endl;
cout<<(*ptr).id<<(*ptr).mark;
}
}
 
السلام عليكم أريد شرحاً لهذا السؤال الـrecursion شوي صعب مو قادرة افهمه
أبغي شرح له شوي

Itcs102
: Function: printlist
You need to create a function called printlist that will create a list of integers based on the 3 parameters: start, end and interval. The function should generate a list of numbers starting with the number start, each successive number should be closer to the number end and the numbers should all be interval apart.
Example1: Example2:
Start=3 end=11 interval=2
The output: 3 5 7 9 11 Start=1 end=650 interval=100
The output: 1 101 201 301 401 501 601

Question1:
Function: multiply_list
You need to create a function called multiply_list that will return the sum of a list of integers based on the 3 parameters: start, end and interval.
Example1: Example2:
Start=1 end=8 interval=2
Resul= 1*3 * 5* 7
Output=The final resul is 105 Start=1 end=200 interval=100
Result: 1*101
Output: The final resul is 101

Question2:
Function: curvedown_list
You need to create a function called curvedown_list that will receive a list of integers, a length and integer interval. The function should decrease each element of the array list by interval..
Example1: Example2:
List[ ] = 3 7 11 1 0
Length=5 interval=2
Result:
List[] =1 5 9 -1 -2 List[ ] = 15 24 1 6 9 7 11 Length=7 interval=1
Result:
List[] =14 23 0 5 8 6 10





#include<iostream>
sing namespace std;
Void printlist (start,end ,interval){
int start, end;
for(int i=start; i<end;i++)
if ( start+1 – start = = start+2 – start+1 )
} ناقصة لوعت جبدي...


float multiply_list(start,end ,interval){
if(
else return




​

أتمنى شرح وافي للسؤال لان لحين مو مستوعبة الجبتر
 
احد عنده حل توتوريال 6 ,, ضروري !!

باجر عندي اختبار في ال Output .. :tears:

ولو تشرحون لي الحل ,, يكوون افضل !
 
بلييييييييييييز احد يشرح لي شنو يبون بالظبط او الحل

[FONT=&quot]The purpose of this assignment is to overload some operators and use a template class.[/FONT]
[FONT=&quot]Consider the following program. Answer all questions and fill up the [/FONT][FONT=&quot]????? [/FONT][FONT=&quot]with appropriate.[/FONT][FONT=&quot][/FONT]
[FONT=&quot]#include[/FONT][FONT=&quot]<iostream>[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]template[/FONT][FONT=&quot]<class Type>[/FONT]
[FONT=&quot]class[/FONT][FONT=&quot] AnyListType[/FONT]
[FONT=&quot]{[/FONT]
[FONT=&quot]public[/FONT][FONT=&quot]:[/FONT]
[FONT=&quot] AnyListType();[/FONT]
[FONT=&quot] AnyListType(int size);[/FONT]
[FONT=&quot] void readList();[/FONT]
[FONT=&quot] void print();[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]Question1: write the definition of ovrloading the ++ operator.[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] AnyListType operator +(AnyListType &otherList);[/FONT]
[FONT=&quot]private[/FONT][FONT=&quot]:[/FONT]
[FONT=&quot] int listSize;[/FONT]
[FONT=&quot] Type List[100];[/FONT]
[FONT=&quot]bool operator [/FONT]
[FONT=&quot]};[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]/*******************************************************/[/FONT]
[FONT=&quot]Question1: put something here so that the function becomes template.[/FONT]
[FONT=&quot]AnyListType<Type>::AnyListType()[/FONT]
[FONT=&quot]{listSize = 5;[/FONT]
[FONT=&quot]}[/FONT]
[FONT=&quot]/*******************************************************/[/FONT]
[FONT=&quot]Question1: put something here so that the function becomes template.[/FONT]
[FONT=&quot]AnyListType ????? ::AnyListType(int size)[/FONT]
[FONT=&quot]{[/FONT]
[FONT=&quot] if ((size<0)||(size>100)) listSize = 5;[/FONT]
[FONT=&quot] else listSize = size;[/FONT]
[FONT=&quot]}[/FONT]
[FONT=&quot]/*******************************************************/[/FONT]
[FONT=&quot]Question1: put something here so that the function becomes template.[/FONT]
[FONT=&quot]void[/FONT][FONT=&quot] AnyListType ????? ::readList()[/FONT]
[FONT=&quot]{ [/FONT]
[FONT=&quot]Question2: [/FONT][FONT=&quot]use a loop to prompt the user to key in the List elements.[/FONT]
[FONT=&quot]}[/FONT]
[FONT=&quot]/*******************************************************/[/FONT]
[FONT=&quot]Question1: put something here so that the function becomes template.[/FONT]
[FONT=&quot]void[/FONT][FONT=&quot] AnyListType<Type>::print()[/FONT]
[FONT=&quot]{[/FONT]
[FONT=&quot]Question3: use a loop to output the List elements :RpS_crying::RpS_crying::RpS_crying:[/FONT]
 
عودة
أعلى أسفل