In C write a program that reads time and date of birth in nu

In C++ write a program that reads time and date of birth in numeric form such as

8-27-1980 10:56:59 pm or 8-27-1980 22:56:59.

If the time is in 12-hour notation and the date is in numeric form. The program then outputs the time in 24-hour notation and the date of birth in the form: August 27th, 1980 hh:mm:ss.

If the time is in 24-hour notation and the date is in numeric form. The program then outputs the time in 12-hour notation and the date of birth in the form: August 27th, 1980 hh:mm:ss am or pm.

Your program must contain at least 5 exception classes: InvalidHour, InvalidMinute, InvalidSec, InvalidDay, and InvalidMonth.

If an invalid value for hour, minute, second, day or month was read, then the program should throw and catch the correct matching object. Don\'t worry about the Leap Year. An example may look like this:

8-27-1980 10:56:59 pm or 8-27-1980 22:56:59.

You were born on August 27th, 1980 at 22:56:59

If invalid information was read, make sure you display a message stating that error, for example:

8-32-1980 15:61:00 am

will result into:

Invalid day:        32

Invalid hour:       15

Invalid minute:     61

Invalid timeperiod: am

Please upload the following:

The class .cpp file

The main program

The class .h file

Output File

Solution

/*
* date.cpp
*
* Created on: 21-Nov-2016
* Author: kasturi
*/


#include <iostream>
#include <fstream>
using namespace std;

class DateTimeEvaluation
{
  
};
class InvalidHour
{
   int hour;
   void process()
   {
      
   }
};

class InvalidMinute
{

};

class InvalidSec
{

};

class InvalidDay
{

};

class InvalidMonth
{

};
void readFromFile()
{
   ifstream infile(\"date.txt\");
   string line;
   while(getline(infile, line))
   {
      
   }
}

int main()
{
   return 0;
}

In C++ write a program that reads time and date of birth in numeric form such as 8-27-1980 10:56:59 pm or 8-27-1980 22:56:59. If the time is in 12-hour notation
In C++ write a program that reads time and date of birth in numeric form such as 8-27-1980 10:56:59 pm or 8-27-1980 22:56:59. If the time is in 12-hour notation

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site