Question: find errors and rewrite the whole the whole code amd mention where changes are made: #include class Date { private: int day,month,year; public: / /

find errors and rewrite the whole the whole code amd mention where changes are made:
#include
class Date
{
private:
int day,month,year;
public:
// constructor
Date()
{
day=0;
month=0;
year=0;
std::cout<<"Constructor called"<(Date obj){
if(day>obj.day && month>obj.month && year>obj.year)
{
return 1;
}
else{
return 0;
}
}
// equal to operator
bool operator ==(Date obj){
if(day==obj.day && month==obj.month && year==obj.year)
{
return 1;
}
else{
return 0;
}
}
// greater then equal to
bool operator <=(Date obj){
if(day<=obj.day && month<=obj.month && year<=obj.year)
{
return 1;
}
else{
return 0;
}
}
// less then equal to
bool operator >=(Date obj){
if(day>=obj.day && month>=obj.month && year>=obj.year)
{
return 1;
}
else{
return 0;
}
}
// assigment operator
bool operator=(Date obj){
if(day=obj.day && month=obj.month && year=obj.year)
{
return 1;
}
}
// increment operator
void operator ++()
{
day++;
month++;
year++;
}
Date operator ++(int){
Date temp;
day++;
month++;
year++;
return temp;
}
// decrement operator
void operator --()
{
day--;
month--;
year--;
}
Date operator --(int){
Date temp;
day--;
month--;
year--;
return temp;
}
friend std::ostream& operator<<(std::ostream& os, const Date& dt )
{
os << dt.day<<"/"<< dt.month <<"/"<< dt.year;
return os;
}
friend std::iostream& operator>>(std::iostream& is, const Date& dt)
{
is >> dt.day >> dt.month >> dt.year;
return is;
}
};
int main()
{
Date d1(12,05,2025);
Date d2(27,12.2003);
// arthmetic operators
Date sum = d1+d2;
std::cout<<"result of Addition "d3;
std::cout<<"you entered"<

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!