Question: CPP TEMPLATE GIVEN: / / comments #include #include #include #include using namespace std; void get _ input ( int& month, int& day, int& year )

CPP TEMPLATE GIVEN:
// comments
#include
#include
#include
#include
using namespace std;
void get_input(int& month, int& day, int& year);
// post-condition: get the input of a date. If the date is NOT valid, will prompt the user to reenter a valid date
void get_input(int& month, int& year);
// post-condition: get the input of a month. If the month is NOT valid, will prompt the user to reenter a valid month
void get_input(int& year);
// post-condition: get the input of a year. If the date is NOT valid, will prompt the user to reenter a valid year.
// the year must be later than 1582 in order to be valid.
bool isValid(int month, int day, int year);
// post-condition: return true if the specified date is valid, false otherwise
bool isValid(int month, int year);
// post-condition: return if the specified month is valid, false othewise
bool isValid(int year);
// post-condition: return true if the given year is valid. false otherwise.
// the given year is valid if it is later than year 1582.
void print_calendar(int month, int day, int year);
// pre-condition: the date is a valid date
// post-condition: print out the day of week for specified date. For example, print_calendar(10,15,2014) will print out
// October 15,2014 is Wednesday
void print_calendar(int month, int year);
// pre-condition: the month is a valid month, and the year is a valid year
// post-condition: print out the calendar of specified month
void print_calendar(int year);
// pre-condition: the year is a valid year
// post-condition: print out the calendar of specified year
string monthName(int month);
// pre-condition: the month value is 1,2,..,12
// post-condition: return a string that represents the name of the month. If month is 1, the name is "January" and so on
int daysInMonth(int month, int year);
// pre-condition: the month and year are valid
// post-condition: return the number of days in the given month in given year
void menu();
// post-condition: the menu is displayed for choose
bool isLeapYear(int year);
// pre-condition: the year is valid
// post-condition: return true if the year is leap year; false otherwise
int getCenturyValue(int year);
// pre-condition: the year is valid
// post-condition: return the century value of the given year.
int getYearValue(int year);
// pre-condition: the year is valide
// post-condition: return the year value of the given year.
int getMonthValue(int month, int year);
// pre-condition: the month and year are valide
// post-condition: return the month value of the given month in given year.
int dayOfWeek(int month, int day, int year);
// pre-condition: the date is valid
// post-condition: return 0 if the date is Sunday, 1 if the date is Monday and so on
string dayOfWeek(int day);
// pre-condition: day has integer value 0,1,2,3,4,5, or 6
// post-condition: the name of the day of week is returned as a string.
// If day has value 0, then SUNDAY is returned; 1, then MONDAY is returned
// and so on
//************************************************************************
// You may have implemented all functions above for project 5
// Implementation all functions above are given in this file
// They are the solution for Project 5 and more.
// You must implement the functions below. Also, you must change the menu
// option accordingly and add one more case in main function
//***********************************************************************
bool print_calendar(int year, string fileName);
// pre-condition: year is a leagal year, and fileName is the name of output file
// post-condition: if the calendar of the given year is successfully output to the file
// with name fileName, return true; false otherwise
void print_calendar(int month, int year, ofstream& output);
// pre-condition: month is a legal month in a given legal year and output is an ofstream
// that connected to a successfully opened file
// post-condition: the calendar of the given month of given year is output to a file
// through the output.
int main()
{
char choice;
int day, month, year;
do
{
system("CLS");
menu();// display menu by calling menu function
cout"
\tPlease enter your choice: ";// ask user to enter his/her choice on menu
cin>>choice;// get user's choice
switch(choice)
{
case '1': // will query a date.
get_input(month, day, year);
print_calendar(month, day, year);// print out the day of week of specified date
break;
CPP TEMPLATE GIVEN: / / comments #include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!