شيئية OOP
282 subscribers
53 photos
10 files
12 links
عمي رحمة لوالديك ولعشيرتك وللعزاز وللعراق وللشرق الأوسط، لا تكعد تحفظ الأكواد
الكود فهم فهم فهم مو حفظ
و السلام
Download Telegram
شيئية OOP
مثال عن polymorphism : #include <iostream> using namespace std; class Shape { public: virtual double area() = 0; }; class Circle : public Shape { private: double radius; public: Circle(double r) { radius = r; } double area() { return…
هذا السؤال

بس يكلك سويه بالابستراكشن
هيج يصير
#include <iostream>
using namespace std;

class Shape {
public:
virtual void area() = 0;
};


class Circle : public Shape {
private:
double radius;

public:
Circle(double r): radius(r){}

void area() {
cout << "Circle area: "<< 3.14 * radius * radius << endl;
}
};


class Rectangle : public Shape {
private:
double length;
double width;

public:
Rectangle(double l, double w): length(l), width(w) {}

void area() {
cout << "Rectangle area: " << length * width << endl;
}
};


int main() {
Circle circle(5);
Rectangle rectangle(4, 6);

circle.area();
rectangle.area();

return 0;
}

اول يكلك سويه بمفهوم توقع المشاكل ( catch , try , throw )
ايضا سهل
جربوه بطريقكم
4🔥1
هذني هن الافكار الممكنة
عليك فهم الكود
لان ما راح يجي نصاً
ممكن يعدل عليه شي بسيط
و اضافات ما تأثر
مثلا يكلك المتغيرات نفس الاسم بالكونستركتر
هنا تستخدم
this->
و موجود مثال بالقناة ( سؤال رقم 12 )

او يكلك سوي سكوب ( : : )
وهيج سوالف
👍8👏1
و اول سؤال حفظيات بله
عليه عشر درجات
أقروا الملف و فكروا بنفس نمط فراغات المد
كذلك ممكن يكرر بعض الفراغات لان الاغلبية ما مجاوبة
👍10
شيئية OOP
الحل : #include<iostream> using namespace std; class carengine { public: virtual void check()=0; }; class Water : public carengine { private: int watertemperature; public: Water(int w = 0):watertemperature(w){} void check() { …
الكوز
هو وحش الهياكل لان طبق بيه مواضيعنا كلها تقريباً ( بدون الاوفرلودنك طبعاً )
فعملياً هذا الي يطبقه و يفهمه
وضعه كلش حلو باجر
👍5
اسئلة فاينل الهياكل OOP بتاريخ :
2024/5/22
💔14🤓4😨42
شيئية OOP
Photo
Q1/
1-Instance
2-Blueprint
3-Alias
4-Nullptr
5-Overloading
6-early binding
7-Abstraction
8-abstract data type
9-encapsulation
10-problem
2👍2💔2
شيئية OOP
Photo
Q2/

A/
#include<iostream>
using namespace std;
class Rectangle
{
protected:
double lenght,width;
public:
Rectangle(double l,double w):lenght(l),width(w){}
};

class cuboid : public Rectangle
{
double height;
public:
cuboid(double l,double w,double h):Rectangle(l,w),height(h){}
void volume()
{
cout<<"area of cuboid : "<<lenght*width*height<<endl;
}
};

int main()
{
cuboid r(2.2,10.5,5.2);
r.volume();
}


B/
#include<iostream>
using namespace std;

class Cars {
private:
string brandN;
int maxspeed, fuelC, safetyR;
public:
Cars(string b,int m,int f,int s):brandN(b),maxspeed(m),fuelC(f),safetyR(s){}
bool operator>(const Cars& other) const {
int pointA=0, pointB=0;
if (maxspeed>other.maxspeed) {
pointA++;
} else {
pointB++;
}
if (fuelC<other.fuelC) {
pointA++;
} else {
pointB++;
}
if (safetyR>other.safetyR) {
pointA++;
} else {
pointB++;
}
return pointA > pointB;
}
};

int main() {
Cars BMW("BMW",300,5,10);
Cars KIA("KIA",200,4,5);
if(BMW > KIA) {
cout <<"BMW has a higher assessment"<< endl;
}else{
cout <<"KIA has a higher assessment"<< endl;
}
return 0;
}
4❤‍🔥4💊3👍1
شيئية OOP
Photo
Q3/

A/
#include<iostream>
using namespace std;
class Item
{
protected:
string title,author;
int ISBN;
public:
Item(string t,string a,int i):title(t),author(a),ISBN(i){}
virtual void buy(bool p){
cout << "the virtual function" << endl;
}
};
class Book : public Item
{
public:
Book(string t,string a,int i):Item(t,a,i){}
void buy(bool p)
{
if(p)
{
cout<<title<<" by "<<author<<endl<<"ISBN :"<<ISBN<<endl;
}
else
{
cout<<"book unavailable"<<endl;
}
}
};
class DVD : public Item
{
public:
DVD(string t,string a,int i):Item(t,a,i){}
void buy(bool p)
{
cout<<title<<" by "<<author<<endl<<"ISBN :"<<ISBN<<endl;
}
};
int main() {
Book adeq("legend of zelda","ahmed",503);
DVD n("mario songs","marimaker",163);
Item* ptr;

ptr=&adeq;
ptr->buy(true);

ptr=&n;
ptr->buy(0);
}


B/
#include<iostream>
#include<stdexcept>
using namespace std;
class nuclear_reactor
{
protected:
int temperature,pressure;
double radiation_levels;
public:
nuclear_reactor(int t,int p,double r):temperature(t),pressure(p),radiation_levels(r){}

};
class monitoring : public nuclear_reactor
{
public:
monitoring(int t,int p,double r):nuclear_reactor(t,p,r){}
void checktemp()
{
if(temperature>1000)
{
throw "temperature is too high";
}
else cout<<"temperature is normal"<<endl;
}
void checkpressure(){
if (pressure>2000)
{
throw"pressure is too high";
}
else cout<<"pressure is normal"<<endl;
}
void checkrad() {
if (radiation_levels>0.1)
{
throw"high radiation";
}
else cout<<"normal radiation"<<endl;
}
};
int main() {
monitoring a(1100,1700,0.03);
monitoring b(900,1500,0.02);
try{
a.checktemp();
a.checkpressure();
a.checkrad();
}catch(const char* msg)
{
cerr<<msg <<endl;
}
try{
b.checktemp();
b.checkpressure();
b.checkrad();
}catch(const char* msg)
{
cerr<<msg <<endl;
}

}
6
الحل مقدم من أحد الطلبة 〔 〕
3
ملاحظة/
الاسئلة تنحل بأكثر من طريقة
لذلك كل شخص و طريقته و تكون صحيحة ان شاء الله
مو شرط نفس الطريقة
5
البرمجة :

ملزمة دفعة²⁵ + حلول الواجبات:
https://t.me/Q_code_cpp/311


شروحات:
شرح كامل للغة Cpp من الصفر:
https://youtube.com/playlist?list=PLEPx7DrqAqKAJm4wM3r7FvvX7y6tuBOAQ&si=moNpvaL7IPGRFJv8

شرح المتسلسلة سؤال 31:
https://t.me/no_zero_any_more/359
طريقة عمل اللوب باستخدام الفنكشن فقط:
https://t.me/no_zero_any_more/360
سؤال سلسلة تايلور للساين:
https://t.me/no_zero_any_more/362
انواع الفنكشن الاربع:
https://t.me/no_zero_any_more/364
شرح سؤال 74 مهم جداً:
https://t.me/no_zero_any_more/371
كل العمليات الرياضية والمنطقية الي بل برمجة:
https://t.me/no_zero_any_more/373
شرح سؤال 51:
https://t.me/no_zero_any_more/379

الفيديوهات على اليوتيوب:
https://www.youtube.com/channel/UCQCagTCsQ2eIYYCPOCngTIQ/

الأكواد 75 سؤال:
الاسئلة الـ 75:
https://t.me/Q_code_cpp/308

الـ 75 كاملة بحل أحد الطلبة:
https://t.me/Q_code_cpp/266

بطريقة حلي:
من هذا الرابط لحد سؤال 50 فقط:
https://t.me/Q_code_cpp/2
سؤال 51:
https://t.me/Q_code_cpp/58
سؤال 52:
https://t.me/Q_code_cpp/59

اسئلة عن الـ Function:
https://t.me/Q_code_cpp/56
https://t.me/Q_code_cpp/57

اسئلة الـ Array:
https://t.me/no_zero_any_more/326

قوانين رياضية بصيغ برمجية:
https://t.me/no_zero_any_more/345

اسئلة المد:
https://t.me/Q_code_cpp/268
اسئلة الفاينل:
https://t.me/Q_code_cpp/270
اسئلة المحاولة الثانية:
https://t.me/Q_code_cpp/281
حل اسئلة المحاولة الثانية:
https://t.me/Q_code_cpp/290
https://t.me/Q_code_cpp/291
https://t.me/Q_code_cpp/294

الدور الأول²⁰²⁵:
https://t.me/Q_code_cpp/318
حل اسئلة الدور الأول²⁰²⁵:
https://t.me/Q_code_cpp/321

الدور الثاني²⁰²⁵:
https://t.me/Q_code_cpp/333
2
75 c++ exercises.cpp
55.9 KB
75 c++ exercises.cpp
👍2
اسئلة المد / البرمجة وحل المشاكل
ملاحظة/
سؤال 1، هذا حفظ من الفصل الأول يولي حذفه

شرح العمليات المنطقية :
https://t.me/no_zero_any_more/373

Q2 /
1) 6 ( هاي شفت العنصر مرتين بجهة اليمين ( ال y = 25 بالباينري 11001 تشفتها مرتين تصير 00110 = 6 )

2) 20
هاي مقارنة بين البتات هيج تصير
x = 1101 , y = 11001
نساوي بينهن
x = 01101
y = 11001
هسه نقارن مرتبة الx ويه الy واذا متشابهات الناتج صفر و اذا مختلفات الناتج واحد
ف تصير 10100 وهاي تساوي 20

3) 1 ( ويعني true لان يكلك x لا يساوي y وهذا صحيح لان x = 13 و y = 25 )

Q3 /
1- sizeof
2- Bool
3- operating system
👍1
اسئلة الفاينل / البرمجة وحل المشاكل

شرح العمليات المنطقية :
https://t.me/no_zero_any_more/373

Q1 /
A -
1) 16 ( لان عملية ناقص - - بجهة اليمين ف ما تشتغل )
2) 1 ( يعني true لان عملية جمع منطقية بوابة OR )
3) 0 ( يعني false لان مقارنة هاي اذا x يساوي y وهن غير متساويات)
4) 2 ( ناتج القسمة لان y/x = 16/8 و ناتجها 2 )
5) 4 ( هاي شفت العنصر مرة واحدة بجهة اليمين ( موضوع اللوجك بالكورس الثاني التشفيت) بالباينري 8 = 1000 ، شفت مرة وحدة تصير 0100 = 4 )

B -

1- relational operator ( ص26 )
2- logical operator ( ص28 )
3- ^=
موجود بـ ( ص29)
4- break
5- end
1👍1
الهياكل OOP :

شروحات :
في نهاية القائمة ( بوينتر، رفرنس، ستركت، Inline ) :
https://youtube.com/playlist?list=PLCInYL3l2AajFAiw4s1U4QbGszcQ-rAb3&si=3vYmdgld5-Dwv_UF

شرح لـ OOP :
https://youtube.com/playlist?list=PLCInYL3l2Aaiq1oLvi9TlWtArJyAuCVow&si=RPVhIKrXhbp-a8Il

بنهاية هاي القائمة موجود شرح عن OOP
من فيديو 131:
https://youtube.com/playlist?list=PLEPx7DrqAqKAJm4wM3r7FvvX7y6tuBOAQ&si=moNpvaL7IPGRFJv8


الحفظيات :
https://t.me/Q_code_cpp/243

حلول الـ Exercises الـ 18 سؤال :
https://t.me/Q_code_cpp/141
اسئلة المختبر :
المختبر الأول : ( كان من الملزمة بوينتر ، رفرنس ، ستركتر ) .
المختبر الثاني :
https://t.me/Q_code_cpp/69
المختبر الثالث :
https://t.me/no_zero_any_more/949
المختبر الرابع :
https://t.me/Q_code_cpp/90
المختبر الخامس :
https://t.me/Q_code_cpp/163
المختبر السادس :
https://t.me/Q_code_cpp/174
المختبر السابع :
https://t.me/Q_code_cpp/186

الكوز الأول :
https://t.me/Q_code_cpp/67
الكوز الثاني :
https://t.me/Q_code_cpp/197

اسئلة المد + الحل :
https://t.me/Q_code_cpp/180
مِد 2025:
https://t.me/Q_code_cpp/323

بالنسبة لمد المختبر فكان من ال18 سؤال .

اسئلة الفاينل + الحل :
https://t.me/Q_code_cpp/257

الدور الأول²⁰²⁵:
https://t.me/Q_code_cpp/331

الدور الثاني:
https://t.me/Q_code_cpp/298
حل الدور الثاني:
https://t.me/Q_code_cpp/301
https://t.me/Q_code_cpp/302

الدور الثاني²⁰²⁵:
https://t.me/Q_code_cpp/335

فاينل المختبر :
https://t.me/Q_code_cpp/212
حلول :
https://t.me/Q_code_cpp/214
https://t.me/Q_code_cpp/215

بعض الأمثلة من عندي الي شفت الدكتور تكلم عنها او لمح لها :
https://t.me/Q_code_cpp/168
https://t.me/Q_code_cpp/218
https://t.me/Q_code_cpp/251