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

TO BE CODED IN C++. MAKE SURE TO have these two files: When complete there are 2

ID: 3866563 • Letter: T

Question

TO BE CODED IN C++.

MAKE SURE TO have these two files:

When complete there are 2 files to submit, ConsoleWindowClock.cpp which will contain the function main that implements your program and the file TimeClass.cpp which is the implementation of the functions declared in TimeClass.h.

You need to create the files, they are not given to you

For this project you are to finish programming an application that opens a Console window, asks for some information and displays the time, day of the week, and the date. The application updates the time every second and also displays it in various colors. It will be your responsibility to complete the "CTimeClass" that is partially implemented/defined in "TimeClass.h" and "TimeClass.cpp" Since the beginning of this class we have been putting all of our code into one file. In the real world this is not the case. Just as we break up our program and place code in functions, we can also do a better job at organization by putting code in separate files. As long as the compiler and linker know of them, the end result is exactly the same. "h" files (header) typically contain declarations. In this programming exercise they will contain the class declarations. The "cpp" (implementation) files contain definitions. For this project you will download the zipped file that contains a VS2017 solution that contains all of the files that you will need. Please make sure that you extract or copy the files to another directory and not just double click on the solutions file (sln) inside the zip file. If you do VS2017 will complain that the project was not loaded correctly. Again it is your job to complete the program implementation and flesh out CTimeClass The Code "CConsoleClass" is a class that encapsulates some of the functionality of the console window. You do not have to change anything in this class. Just create an instance of it and call it's methods/functions. See the header and implementation files for comments. "CTimeClass" is a class that encapsulates the functionality dates and time. "TimeClass.h" is complete. You only need to implement the following functions in the file "TimeClass.cpp"

Explanation / Answer

#include "TimeClass.h" //////////////////////////////////////////////////////////////////////////// // Class to help with the usage of time. ////////////////////////////////////////////////////////////////////////// CTimeClass::CTimeClass() { // Notice that the time is stored whenever this time object is created. // Use this to your advantage in "main". // "m_st" holds the time and date information. GetLocalTime(&m_st); } //////////////////////////////////////////////////////////////////////// CTimeClass::~CTimeClass() { // Empty - Nothing to destroy here. } short CTimeClass::Year() { // Place your code here to return the year as a short. ConsoleTime ct; short year = ct.wYear; return year; } /////////////////////////////////////////////////////////////////////////// string CTimeClass::Month() { ConsoleTime ct; int month = cm.wMonth; if (month == 0) return "January"; else if (month == 1) return "February"; else if (month == 2) return "March"; else if (month == 3) return "April"; else if (month == 4) return "May"; else if (month == 5) return "June"; else if (month == 6) return "July"; else if (month == 7) return "August"; else if (month == 8) return "September"; else if (month == 9) return "October"; else if (month == 10) return "November"; else if (month == 11) return "December"; else return "error"; // Place your code here to return the month as a string. } ////////////////////////////////////////////////////////////// short CTimeClass::Day() { ConsoleTime ct; short day = ct.wDay; return day; // Place your code here to return the day as a short. } ////////////////////////////////////////////////////////////////////// string CTimeClass::DayOfWeek() { ConsoleTime ct; int day == st.wDayOfWeek; if (day == 0) return "Sunday"; else if (day == 1) return "Monday"; else if (day == 2) return "Tuesday"; else if (day == 3) return "Wednesday"; else if (day == 4) return "Thursday"; else if (day == 5) return "Friday"; else if (day == 6) return "Saturday"; else return "error"; // Place your code here to return the day of the week as a string. } ////////////////////////////////////////////////////////////////// short CTimeClass::Hour() { ConsoleTime ct; short hour = ct.wHour; return hour; // Place your code here to return the hour as a short. } /////////////////////////////////////////////////////////////////////////// short CTimeClass::Minute() { ConsoleTime ct; short minute = ct.wMinute; return minute; // Place your code here to return the minute as a short. } /////////////////////////////////////////////////////////////////////////// short CTimeClass::Second() { ConsoleTime ct; short second = ct.wSecond; return second; // Place your code here to return the second as a short. } // ConsoleWindowClock.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "ConsoleClass.h" #include "TimeClass.h" #include #include #include #include using namespace std; int main() { int width; int height; int fontsize; int text; int background; int userclass; int time; userclass.ConsoleColor(text, background); userclass.ConsoleWindowSize(width, height); userclass.FontSize(fontsize); cout