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

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

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

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

شنو الأوت بوت لهالسؤال .

كود:
What is the output of the following C++ code?
void f1(int x, int & y, int *z)
{
x++;
y++;
(*z)++;
}
int main()
{
int i=1, j=1, k=1;
f1(i, j, &k);
cout<<i<<"\t"<<j<<"\t"<<k<<endl;
return 0;
}
 
سلام
شلون نسوي بارت a
class Employee{ private:string * firstName;string * lastName;static int empCount;public:Employee(string first, string last);~Employee();string getFirstName();static int getEmpCount();static int counting;};​
PART (A) [8 Points]​
Write the definition of the constructor function​
Employee(string first, stringlast); which dynamically allocates memory for firstName and lastName and copies first​
and last to them. The function should increment empCount by 1. Use deep copy.
 
شنو الأوت بوت لهالسؤال .

كود:
What is the output of the following C++ code?
void f1(int x, int & y, int *z)
{
x++;
y++;
(*z)++;
}
int main()
{
int i=1, j=1, k=1;
f1(i, j, &k);
cout<<i<<"\t"<<j<<"\t"<<k<<endl;
return 0;
}

طلع لي 121 لانه بس الجيي يتغير بسبب الريفرينس في الواي
اما اللي صوب الكيي هاذي آآدرس الكي :99:
 
سويته كوبي من البرنامج
كل الفنكشن اللي اسويهم يطلع لي مثل الشي
. .
جوف هذي
يبون نطلع فيها الـ vaules
كود:
#include<iostream>
using namespace std;
int vaules(char *s)
{
    int count=0;
    while(*s != '\0')
    {
        if ((*s=='a') || (*s=='e') || (*s=='i') || (*s=='o') || (*s=='u'))
            count ++;
        s++;
    }
    return count;
}
int main() {
    char *s;
    char zainab;
    s=zainab;
    cout<< vaules(s);
    return 0;
}
يطلع لي الايرور 1>c:\users\glory\documents\visual studio 2010\projects\r\r\678.cpp(17): error C2440: '=' : cannot convert from 'char' to 'char *'

لو تخلينه جذي!

عشان يحسب كل الحروف:99:!char s[ ] = "zainab
 

What is the output of the following C++ code?int * findK (int x[],int L, int k, int* p1){​
​
int i; int * pk=NULL;for (i=1; i< L; i++){ if (*(x+i)== k){*p1=i; *(x+i)=0;pk=x+i; break;}​

} return pk;}//End of findKint main(){​
​
int y[4]={10,2,-5,8};int m=-5, n=-1;int * pn= &n;cout<<m<<" "<<n<<" "<<*pn<<endl;pn=findK(y, 4, m, pn);cout<<m<<" "<<n<<" "<<*pn<<endl;​
return 0;}

احد يتدرب على هذي ويقولي شنو الاوت بوت؟؟؟؟
:RpS_scared:
 
يطلع لي
-5 -1 -1
-5 2 2
بس البرنامج يطلع اخر شي 0 مو 2
 
يطلع لي
-5 -1 -1
-5 2 2
بس البرنامج يطلع اخر شي 0 مو 2

يعني الان ما لها علاقه بالبي اان؟؟؟؟؟؟؟؟؟؟؟؟؟


انا طلع لي اول شي 2
بس عقب جفت انه الاااي تبداء بواحد بصار اركس اللي هي 0 +الاي اللي حصلنا فيها -5 وهي 3
3+0=3

والبرنامج تقولين طلع لج 0

يااربي اشلون تنحل :no:
 
مادري !! هو في شي في الاري يطلع صفر بس ماليه علاقه فيها
 
Consider the following definition of the class​
Employee:​
class Employee{ private:string * firstName;string * lastName;static int empCount;public:Employee(string first, string last);~Employee();string getFirstName();static int getEmpCount();static int counting;};​
PART (A) [8 Points]​
Write the definition of the constructor function​
Employee(string first, stringlast); which dynamically allocates memory for firstName and lastName and copies first​
and last to them. The function should increment empCount by 1. Use deep copy.
انزييين احد يفهمني هذاا
 

What is the output of the following C++ code?int * findK (int x[],int L, int k, int* p1){​
int i; int * pk=NULL;for (i=1; i< L; i++){ if (*(x+i)== k){*p1=i; *(x+i)=0;pk=x+i; break;}​

} return pk;}//End of findKint main(){​
int y[4]={10,2,-5,8};int m=-5, n=-1;int * pn= &n;cout<<m<<" "<<n<<" "<<*pn<<endl;pn=findK(y, 4, m, pn);cout<<m<<" "<<n<<" "<<*pn<<endl;​
return 0;}

احد يتدرب على هذي ويقولي شنو الاوت بوت؟؟؟؟
:RpS_scared:
الأوت بوت يطلع
كود:
-5 -1 -1
-5 2 0

يطبع 0 و 2 في النهاية لأن
طرشنا للفنكشن عنوان الـ n
في الفنكشن p1 تحتوي على عنوان الـ n
و القيمة إلي يأشر عليها الـ p1 تغيرت إلى 2 و هذا غير قيمة الـ n إلى 2
كود:
*p1=i;

السطر التالي غير قيمة الـ -5 إلي في أري إلى 0
كود:
*(x+i)=0;
و السطر التالي
كود:
pk=x+i;
يخلي الـ pk تأشر على الصفر
و في النهايه رجع هذي القيمة

فبعد ما يطلع من الفنكشن
الـ m تساوي -5
الـ n تساوي 2
الـ pn يأشر على الـ 0 إلي في الأري
 
Consider the following definition of the class​
Employee:​
class Employee{ private:string * firstName;string * lastName;static int empCount;public:Employee(string first, string last);~Employee();string getFirstName();static int getEmpCount();static int counting;};​
PART (A) [8 Points]​
Write the definition of the constructor function​
Employee(string first, stringlast); which dynamically allocates memory for firstName and lastName and copies first​
and last to them. The function should increment empCount by 1. Use deep copy.
انزييين احد يفهمني هذاا



كود:
[FONT=Courier New]Employee(string first, stringlast);
{
firstName=new string;//allocate memory
*firstName=first;//copy the value
lastName=new string;
*lastName=last;
empCount++;//increment empcount
}[/FONT]
 
السلام عليكم ورحمة الله وبركاته



شخباركم شعب ITCS102 - ITCS104 ؟؟ :shiny:



هذا الموضوع مخصص لـ ITCS102 - ITCS104



للأسئلة والشرح والاسايمنتات وكل مايتعلق بالمقرر



بالتوفيق جميعاً ان شاء الله :smile2:
​
 
جايني حماس للمادة :shiny:
اليوم الدكتور بعد ريحتنا من المادة قالت اننها اسهل من CS103
..
علامات تعجب انتين اي سكشن عفر ؟
​
 
جايني حماس للمادة :shiny:
اليوم الدكتور بعد ريحتنا من المادة قالت اننها اسهل من CS103
..
علامات تعجب انتين اي سكشن عفر ؟




ايي كل الي سألتهم قالو لي نفس الكلام انه اسهل من الي قبله

يقولون اني في سكشن 13 .. بس مادري من الي بدرسنا

الله يستر !
​
 



ايي كل الي سألتهم قالو لي نفس الكلام انه اسهل من الي قبله

يقولون اني في سكشن 13 .. بس مادري من الي بدرسنا

الله يستر !




ايه قالت الدكتور ان اكثر شي اري وفنكشن و بناخذ شي جديد الكلاس ع قولتها ..
اني سكشن 8
​
 
عودة
أعلى أسفل