C++ coding
in C++
please see the attachments to check the main instruction for this assignment.
some q/a to help it from an instructor
Operator overloading Q/A
Q: This is from the lecture but I don’t really understand what’s going on here:
Date d4;
//later
d4 = d1;
A: Here we can do direct assignment if we overloaded the assignment operator for the Date
Q: Assignment or copy constructor?
A:
Date d1;
Date d2 = d1;//this is a copy constructor. The same as if I said:
Date d2(d1);
//this is assignment:
Date d1, d2;
////later
d1 = d2;
Q: “But what do I add? Days? Months? Years? There is some ambiguity here. Not to overload. “
Wouldn’t it do all of them?
A: If I have:
Date d;
……
d = d + 5;
Is it clear what do I add to that date d?
Q: Why is that istream and ostream?
A: in one case you enable the direct input to the Date, in other case you enable direct output. So you can:
Date d;
cin>>d; //to read in directly to the d.
cout<<d; //to print directly from the d.
You can place an order similar to this with us. You are assured of an authentic custom paper delivered within the given deadline besides our 24/7 customer support all through.
Latest completed orders:
# | Title | Academic Level | Subject Area | # of Pages | Paper Urgency |
---|---|---|---|---|---|