I have been doin this calendar program and I am completely stuck on how to finish it.i have put what i have been able to do but i cant figure out the next part.
any help at all will be great. please.
the question says.
the line in main that calls output_month should now be changed to a comment for use later.
1) a strange formula due to zeller calculates the day of the week on which any date after jan 1st 1583 occurs. the formula requires the day of the week, the year and the month to calculate the formula.
day: this will be a number between 1 and 31.
year: this is broken into two parts- the century and the decade.
the century is the first two integers of the year.(century=year/100 using integer divison)
the decade is the last two integers of the year.(century=year%100 using integers)
month: march is 1, april is 2, and so on until december is 10, january is 11 and february 12.
the four values are substituted into the formula:
daycode=(((13*month-1)/5)+(decade/4)+(century/4)+decade+day-(2*century))%7
the result of this formula is an integer value for daycode in the range 0 to 6 inclusive.the daycode 0 represents sunday, 1 represents monday etc.
design a function called zeller, called from main,the function has the day mont and year passed to it as parameters and then outputs which day of the week it falls on.
Ammend the zeller function so the user may input the month number in conventional format.
the line in main that calls zeller should now be changed to a comment for use later.
use a switch statement in a seperate function called no_in_month, to return and output the number of days in any month.call the no_in_month function from main,the output should be in main.
change no_in month so now there are two parameters passed to it, the month and the year. amend this function so that leap years may be input. a leap year occurs if the year is evenly divisible by 4.
use the call from main to the zeller function(made a comment in step 5) to output which day of the week any month begins
the outputs described in stepds 7 and 8(the day the month starts and the number of days in the month) may now be used as parameters to be passed to the output_month function.
tidy up the program so that a year and month only are inputs and the appropriate calendar is output.
#include "stdafx.h"
#include <iostream>
using namespace std;
#include <iomanip>
void output_month(int start, int total) {
cout << " S M T W T F S" << endl;
cout << setw(5 * start ) << "";