Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me with this. I need an actually output to screen. I have all the cl

ID: 3576684 • Letter: P

Question

Please help me with this. I need an actually output to screen. I have all the classes made, just need to figure out the read from file and the separation of the line so I can output something.

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

Output needs:

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

Explanation / Answer

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){


        FILE *fp;
        char array[2][16];
                int i;
        char months[12][10] = {"January","February","March","April","May", "June","July","August","September","October","November","December"};
        fp = fopen("birth.txt", "r");
        while(fscanf(fp, "%s", array[i++])!=EOF);
        //cout<<array[i++]<<" ";
        for(i=0;array[0][i];i++)

                cout<<array[0][i]<<" ";
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote