Write a program that inputs a date (e.g., July 4, 2010)and outputs the day of th
ID: 3617552 • Letter: W
Question
Write a program that inputs a date (e.g., July 4, 2010)and outputs the day of the week that corresponds to thatdate.
bool isLeapYear(int year);
This function should return true if year is a leap yearand false if it is not.
pseudocode to determine leap year:
Leap_year = ((year divisible by 400) or (year divisible by 4 andyear not divisible by 100))
int getCenturyValue(int year);
This function should take the first two digits of the year(i.e., the century), divide by 4, and save the remainder. Subtract the remainder from 3 and return this value multiplied by2.
int getYearValue(int year);
This function computes a value based on the years since thebeginning of the century. First, extract the last two digitsof the year. Next, factor in leap years. Divide thevalue from the previous step by 4 and discard the remainder. Add the two results together and return this value.
int getMonthValue(int month, int year );
This function should return a value and will require invokingthe isLeapYear function.
Finally, to compute the day of the week, compute the sum of thedate’s day plus the values returned by: getMonthValue,getYearValue, and getCenturyValue. Divide the sum by 7 andcompute the remainder. A remainder of 0 corresponds toSunday, 1 corresponds to Monday, etc., up to 6 which corresponds toSaturday.
Your program should allow the user to enter any date and outputthe corresponding day in English.
This program should include a void function named getInput thatprompts the user for the date and returns the month, day, and yearusing pass-by-reference parameters. You may choose to havethe user enter the date’s month as either a number (1-12) ora month name.