Goal: Your assignment is to write a C++ program to read in a list of appointment records from a file and output them in a more user-friendly format to the standard output (cout), including the amount to charge each client. In so doing, you will practice using the ifstream class, LO manipulators, and the string class. File format: Here is an example of a file containing three appointment records 1 John Doe 20190110123000 20190110124500 2 Jane Doe 20190110124500 20190110131500 4 Each line records one appointment. As you can see, each line contains 4 different fields: first name, last name, appointment start timestamp and, appointment end timestamp. Here is an explanation of these four fields First and Last name: These represent the first and last name of the appointment's client. Start Timestamp: A 14-digit field giving the year, month, day, hour, minute, and second when the appointment was started. The format is yyyymmddhhmmss. Military time is used for the hour For instance, 20180101011020, means the date was January 1, 2018 and the time was 20 seconds past 1:10am. End Timestamp: A 14-digit field, with the same format as the Start Timestamp. This field represents the time when the appointment ended. In this assignment you can assume that an appointment file contains at least one line. In addition, you may assume that each line has exactly four fields and is terminated by an end of line. It is possible that some fields are not formatted correctly. You should not crash because a field is incorrectly formatted, actually your program should not crash at all. Main Program Here is an example what it should look like when your main program is run on the file above: Filename: data-01.txt Name Begin End Minutes Charge ohn Doe ane Doe Peter Parker Jan 10 12:30:00 2019 Jan 10 12:45:00 2019 15 Jan 10 12:45:00 2019 Jan 10 13:15:00 2019 30 Jan 11 11:00:00 2019 Jan 11 11:20:00 2019 20 100 100 100 The main program first prompts the user to enter a file name. You will open that file for input. If the file is not successfully opened, you will print an informative error message and exit the main program. Filename: bad-file.err Cannot open file bad-file.err Otherwise you will print the five column headers which are shown, and then begin the iterative process of reading the four fields on a line. The four fields should be read into string variables and validated before formatting to be outputted in columns as shown above. Your main program should output the same file name prompt, and same column titles as shown in the screenshot. You should also use the exact same field widths. The widths are: -Full name (First name and Last name): 20 - Begin Time: 22 End Time: 22 Minutes: 8 - Charge: 7 The Charge field should be calculated. This office charges S100 per 30 minutes or fraction, so an appointment that lasted 15 minutes would be charged $100, an appointment that lasted 31 minutes would be charged S200. When there is no more data to read, you will close the file if you explicitly opened it. filename when the file object was constructed, then do not. If you specified the Functions to write You are to write the following three functions for your main program to call: Validation 1) A function that takes one string parameter. This function retums true if the parameter is a valid appointment time, and false if it is not. For the purposes of this assignment, a valid time is a string a. b. c. that is exactly 14 characters long that has only digits that has a valid year, month, day, hour, minute and second value. Remember to consider leap years. The function name should be: IsValidDate Your program will call this validation function on the data it reads from the file. If a data item is not valid then your main program will display an error indication for that item (see below) instead of trying to format the data Formatting 2) A function that takes a string specifying the appointment time, and returns a new string in the form o Appointment time is 20180105110054, your function return o Appointment time s 20180415220054, your function retum Month Day Hour:Minute:Second Year. Examples: Jan 5 11:00:54 2018 Apr 15 22:00:54 2018 Note that you need to validate the date before formatting it, additionally note that the day uses two spaces (like using a setw). The function name should be FormatDateTime 3) A function that takes an int and retums the amount to be charged. This can be done in a single line. The function name should be Charge Error Handling Your main program is should handle incorrectly formatted data field gracefully. Consider the following input file: Peter Parker 20100229110000 20100219120000 Jean-Luc Picard 20120229131500 20120219135959 Tony Stark 20111420010000 20111420010000 Here's how it should look when you run with this file Filename: data-02.txt Name Begin End Minutes Charge Peter Parker Jean-Luc Picard Tony Stark .Invalid Start Time. Feb 19 12:00:00 2010 -1 Feb 29 13:15:00 2012 Feb 19 13:59:59 2012 -1 -1 -1 Invalid Start Time. .Invalid End Time -1 The first record is invalid, because 2010 is not a leap year, and it shows Feb 29 The second record is invalid because the appointment is starting after it ended The third record is invalid because the month is 14, thus invalid Please note how to output invalid date-time and that if that happens minutes and charge should be -1 Program Style Your program needs to be orderly and readable. If you are working a development team and don't write clean long. looking code, you will be unpopular among your colleagues and may not work on that team very Variables should be given descriptive names that start with a lowercase letter and obey the camelCase convention Functions should be given descriptive names that start with an uppercase letter and obey the CamelCase convention. First word of a function name typically should be a verb. Don't use global variables. Global variables sometimes are appropriate, but not in the assignments we will be giving this quarter