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

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

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

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

كم اسايمنت ياخذون ؟

مادري اذا كل الدكاترة نفس الشي >>>
دكتورتنه قالت 6 اساينمتات


شخبار الكوردنيتر لاب او كوردنيتر اساينمنت مادري شسمه :nosweat:

حددده فن وسهل
:eek:​
 
PHP:
#include<iostream>
using namespace std;

	class DateType {
private:
int  day;
int month;
int year;
	
public:
	DateType::DateType(int day=1, int M=1, int year = 1900);
void printDate( );
bool operator<(const DateType&);
friend bool operator==(const DateType&,const DateType);
	
int main()
{
	bool DateType::operator<(const DateType&x);
	{
		if(year<x.year)
			return true;
		if(year==x.year&&month<x.month)
			return true;
		if(year==x.year&&month==x.month&&day<x.day)
			return true;

			return false;
	}
	bool operator==(const DateType&x,const DateType&y)
	{
		return (x.day==y.day&&m.month==y.month&&x.year==y.year);
	}
	cout<<"D1="<<d1.printDate();
	if(D1<D2)
		cout<<"is before D2";
	else
		if(D1==D2)
			cout<<"is equal D2";
		else
			cout<<"is after D2";
}
	}

يطلع لي ايرور واحد ماادري في شنو

ساعدوني ابغي ضروري اليوم

ده السؤال


Consider the class definition below:
class DateType {
private:
int day; // value must be between 1 - 31
int month; //value must be between 1 - 12
int year; //value must be between 1900 - 2020
public:
DateType(int day=1, int M=1, int year = 1900);
void printDate( ); //prints the date in day/month/year format
….. // The function defined in part (a)
….. // The function defined in part (b)
};
For each function in part (a) and (b), write the function prototype (in the space above in the class definition) and the function implementation.
a. Overload the operator < (less than) as a member function of the class, so that the function will return true if the date of the first object comes before the date of the second object.
b. Overload the == (equal) operator as a non-member function of the class.
c. Write a main function to do the following:
- Write a statement to declare an object name D1 of type DateType with the values (12,12,1998).
- Write a statement to declare an object name D2 of type DateType with the values (30,12,2000).
- Write statements to compare between D1 and D2 to print one of the following messages as appropriate:
o D1 = day/month/year is before D2= day/month/year
o D1 = day/month/year is the same as D2= day/month/year
o D1 = day/month/year is after D2= day/month/year
 
PHP:
#include<iostream>
using namespace std;

    class DateType {
private:
int  day;
int month;
int year;
    
public:
    DateType::DateType(int day=1, int M=1, int year = 1900);
void printDate( );
bool operator<(const DateType&);
friend bool operator==(const DateType&,const DateType);
    
int main()
{
    bool DateType::operator<(const DateType&x);
    {
        if(year<x.year)
            return true;
        if(year==x.year&&month<x.month)
            return true;
        if(year==x.year&&month==x.month&&day<x.day)
            return true;

            return false;
    }
    bool operator==(const DateType&x,const DateType&y)
    {
        return (x.day==y.day&&m.month==y.month&&x.year==y.year);
    }
    cout<<"D1="<<d1.printDate();
    if(D1<D2)
        cout<<"is before D2";
    else
        if(D1==D2)
            cout<<"is equal D2";
        else
            cout<<"is after D2";
}
    }

يطلع لي ايرور واحد ماادري في شنو

ساعدوني ابغي ضروري اليوم

ده السؤال


Consider the class definition below:
class DateType {
private:
int day; // value must be between 1 - 31
int month; //value must be between 1 - 12
int year; //value must be between 1900 - 2020
public:
DateType(int day=1, int M=1, int year = 1900);
void printDate( ); //prints the date in day/month/year format
….. // The function defined in part (a)
….. // The function defined in part (b)
};
For each function in part (a) and (b), write the function prototype (in the space above in the class definition) and the function implementation.
a. Overload the operator < (less than) as a member function of the class, so that the function will return true if the date of the first object comes before the date of the second object.
b. Overload the == (equal) operator as a non-member function of the class.
c. Write a main function to do the following:
- Write a statement to declare an object name D1 of type DateType with the values (12,12,1998).
- Write a statement to declare an object name D2 of type DateType with the values (30,12,2000).
- Write statements to compare between D1 and D2 to print one of the following messages as appropriate:
o D1 = day/month/year is before D2= day/month/year
o D1 = day/month/year is the same as D2= day/month/year
o D1 = day/month/year is after D2= day/month/year


أني بعد عندي ون ايرور متورطه فيه :RpS_crying:



binary '<<' : no operator found which takes a right-hand operand of type 'void' (or there is no acceptable conversion)​
 
مني نسيتين الرّفرنس ..؟

كود:
[LEFT][COLOR=#0000BB]friend bool operator[/COLOR][COLOR=#007700]==(const [/COLOR][COLOR=#0000BB]DateType[/COLOR][COLOR=#007700]&,const [/COLOR][COLOR=#0000BB]DateType[/COLOR][COLOR=#007700]); [/COLOR][/LEFT]
​
 
كود:
[LEFT][COLOR=#007700][FONT=monospace] [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]cout[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<<[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"D1="[/FONT][/COLOR][COLOR=#007700][FONT=monospace]<<[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]d1[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]printDate[/FONT][/COLOR][COLOR=#007700][FONT=monospace]();[/FONT][/COLOR][/LEFT]


سمول لتر ..؟؟

عاد اني قاعده و شسمه ان شاء الله ملاحظاتي تفيد يعنو
:whistling:​
 
هههههه
عدلتهم اكو

بس ماادري شسالفة هالايرور
 
هني يطلع ليي إيرور :

كود:
 cout<<"D1"<<D1.printDate( );


هذا الإيرور

كود:
[B]binary '<<' : no operator found which takes a right-hand operand of type 'void' (or there is no acceptable conversion)[/B]

مالحل
..؟!

أحد يساعدني أبي اطلع من البيت حابسني هالأسايمنت
:RpS_crying:
​
 
726046133.jpg
[/url][/IMG]

جذي يطلع
 
اللهم صل على محمد و آل محمد

مادري اذا كل الدكاترة نفس الشي >>>دكتورتنه قالت 6 اساينمتات​

شخبار الكوردنيتر لاب او كوردنيتر اساينمنت مادري شسمه :nosweat:

حددده فن وسهل :eek:


مو فن و لا سهل :RpS_glare:
ماكنت ادري انك عبقرينو :RpS_tongue:
مع اني حسيت حلي منطقي لكن عندي يمكن 11 errors :whistling:


اللهم صل على محمد و آل محمد
​
 
شلون اطرش الاسايمنت ع البلاك بورد
 
أحد عنده فكرآ كــم أسآآيمنت مطلوب؟
 
اللهم صل على محمد و آل محمد



مو فن و لا سهل :RpS_glare:
ماكنت ادري انك عبقرينو :RpS_tongue:
مع اني حسيت حلي منطقي لكن عندي يمكن 11 errors :whistling:


اللهم صل على محمد و آل محمد
​

جان سويتي اللي قلت لج عنه >>>> بطلي اساينمنت الكلاس و كوبي و غيري على حسب السؤال بس

نفسه بالضبط بس العمليات الحسابية غير:whistling:

انا سويته طلع عندي 6 ايرورات اول مرة و كلهم اغلاط في حرف كبتل و سمول و الصفر احطه حرف او
:whistling:


بالتوفييييق جميعا
:shiny:​
 
التعديل الأخير:
شلون اطرش الاسايمنت ع البلاك بورد

1- تطقين على كلمة اساينمنت
2- بتفتح لج صفحة فيها خيارات و جذي (( اختاري brows from my computer))
3- في خانة الكومنت كتبي اللي تبينه (( الرقم الجامعي و الاسم ))
3- عقب طقي submit بتحصلينها تحت

:smile2:​
 
هني يطلع ليي إيرور :

كود:
 cout<<"D1"<<D1.printDate( );


هذا الإيرور

كود:
[B]binary '<<' : no operator found which takes a right-hand operand of type 'void' (or there is no acceptable conversion)[/B]

مالحل
..؟!

أحد يساعدني أبي اطلع من البيت حابسني هالأسايمنت
:RpS_crying:
​

اذا الفنكشن داخلها مسوية cout لازم ما تحطينها في نفس السطر .. خطأ
تسوينها في سطر بروحها ..

PHP:
 cout<<"D1";
D1.printDate( );
 
اللهم صل على محمد و آل محمد

ماجا على بالي
:RpS_unsure:

يصير تخلي الحل بشوف اخطائي :nosweat: ؟

اللهم صل على محمد و آل محمد
​
 
اذا الفنكشن داخلها مسوية cout لازم ما تحطينها في نفس السطر .. خطأ
تسوينها في سطر بروحها ..

PHP:
 cout<<"D1";
D1.printDate( );

صار تو إيرور بدل الون إيرور من شوي ..

ع العموم شكراً لكم
.. اوردي دزيت الاسايمنت خلاص ..​
 
عودة
أعلى أسفل