Question: Modify the Date class to include a read() member function. It should read in the date in the format of MM/DD/YYYY. To do this you

Modify the Date class to include a read() member function. It should read in the date in the format of MM/DD/YYYY. To do this you will need to use a char variable called slash to remove the slash from the input stream. For example, the code

Date myApp;

 cout  

would generate the following output

Modify the Date class to include a read() member function. It should

Create a class Appointment that has a Date, a start and end Time, and string description. The class should have getters and setters as well as read and print functions

 Class Appointment { Public: 
 Appointment(); Appointment(Date, Time, Time, string ); Date getDate() const; Time getStartTime() const; Time getEndTime() const; string getDescription() const; ... 
 Private: Date date; 
 Time start_time; Time end_time; string description; 

};

Programming Assignment 3

Then write a driver to test the Appointment class functions. The driver should create a vector of Appointment objects and then given a users inputted date check which Appointments occur on that Date. Also, ask the user for two dates and output which Appointments are within those Dates.

Non-member function for Time to print and read.

 void print12clock(const Time& t) { 
 int h = t.get_hours(); string meridian; meridian = (h  
 if (h == 0) h += 12; 
 else if (h > 12) h -= 12; 
 if (h  
 cout  
 cout  

}

 // reads in HH:MM void read(Time& t) { 
 char colon; int h, m; 
 cin >> h >> colon >> m; 
 t = Time(h, m, 0); } 
FACP21Datel TestDate2.exe Enter the date of the appointment (MM/DD/yYYY):3/17/2018 You entered March 17, 2018 FACP21Datel TestDate2.exe Enter the date of the appointment (MM/DD/yYYY):3/17/2018 You entered March 17, 2018

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 Databases Questions!