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:
# | topic title | discipline | academic level | pages | delivered |
---|---|---|---|---|---|
6
|
Writer's choice
|
Business
|
University
|
2
|
1 hour 32 min
|
7
|
Wise Approach to
|
Philosophy
|
College
|
2
|
2 hours 19 min
|
8
|
1980's and 1990
|
History
|
College
|
3
|
2 hours 20 min
|
9
|
pick the best topic
|
Finance
|
School
|
2
|
2 hours 27 min
|
10
|
finance for leisure
|
Finance
|
University
|
12
|
2 hours 36 min
|