We write, we don’t plagiarise! Every answer is different no matter how many orders we get for the same assignment. Your answer will be 100% plagiarism-free, custom written, unique and different from every other student.
I agree to receive phone calls from you at night in case of emergency
Please share your assignment brief and supporting material (if any) via email here at: [email protected] after completing this order process.
No Plagiarism Guarantee - 100% Custom Written
In this paper, you are required to derive class Week-Day from class Date-Time. You are required to display local date time using values from the parameters.
Derive class WeekDay from class DateTime such that WeekDay::display() will display local date time using values from the parameters and the corresponding weekday. For a handy online weekday calculator: What Day is this Date?
class WeekDay : public DateTime {
public:
WeekDay(int y, int m, int d, int h = 0, int min = 0, int s = 0);
void display();
};
Implement
Validate the parameter values the same ways as in DateTime().
display the local date time and the corresponding weekday.
You have to provide:
a header file weekday.h with code to prevent multiple inclusion.
an class implementation file weekday.cpp.
a text file task_2_2.txt containing compilation messages and sample runs.
Note
You have to include the code for class DateTime in weekday.h and weekday.cpp.
Do not modify DateTime and WeekDay class public and protected sections. You may add private members (data/functions) only.
There is no need to implement error exception.
You may use sample_WD_app.cpp to test your implementation. Expected output:
C:>a
01/02/15 03:04:05 is Friday
01/02/15 03:04:00 is Friday
01/02/15 03:00:00 is Friday
01/02/15 00:00:00 is Friday
You should also use your own test cases to test for error inputs.
Marking Criteria
Marks
WeekDay()
2
display()
weekday.h with code to prevent multiple inclusion.
weekday.cpp
Compilation messages and sample run outputs (if the program runs correctly)