Question: The print member function should output the date in the format MM / DD / YYYY with leading zeros as needed, using the C +
The print member function should output the date in the format MMDDYYYY with leading zeros as needed, using the C IOStreams cout object. To get formatting to work with C IOStreams cout look at the setw and setfill manipulator descriptions, or the width and fill functions in the chapter on the C IO System.
#include
#include
#include
using namespace std; or use individual directives, eg using std::string;
class Date
methods and data necessary
;
Use separate files for the Date class definition in Date.h implementation of the member functions Datecpp and the attached test main function DateDemocpp The shortest member functions like getDay may be implemented in the class definition so they will be inlined Other member functions should be implemented in the Date.cpp file. Both Date.cpp and DateDemo.cpp will need to #include the Date.h file since they both need the Date class definition in order to compile and other include files that are needed eg iostream, string, etc
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
