Create a Log class that opens a file, writes messages, and closes the file. The
ID: 3630366 • Letter: C
Question
Create a Log class that opens a file, writes messages, and closes the file.The constructor takes a filename parameter and opens the file.
Supply a method called entry() that takes a string parameter containing the message to be written to the log.
When writing the message to the log, FIRST write a timestamp. Use _strtime_s() to obtain a timestamp.
Keep a count of the number of messages written to the log, and provide a method to return this number.
Close the file in the Log destructor.
Create a main program that instantiates the Log, then writes a few messages to the log. Before the main program exits, display the number of log messages that were written to the file.
Use an editor to open your log file and confirm that the messages were written correctly.