c++ print monthly calendar

the program isn't asking for a year but simply just outputting a few months in the grid like format. i've never taken any programming class so this is all WAYY confusing. I'd appreciate all the help. This is what i have so far.


#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

void printmonth(const int month, const int startday, const bool leap);

int main(void)

{
printmonth(1,0,false); // Print January 1st, on a Sunday
printmonth(2,1,true); // Print February 1st leap year, on Monday
printmonth(1,2,false); // Print January 1st, on a Tuesday
printmonth(2,3,false); // Print February 1st not leap, on Wednesday
printmonth(1,4,false); // Print January 1st, on a Thursday
printmonth(2,5,false); // Print February 1st, on a Friday
printmonth(1,6,false); // Print January 1st, on a Saturday
printmonth(6,1,false); // Print June 1st, on Monday
printmonth(12,4,false); // Print December 1st, on a Thursday
return 0;
}
void printmonth(const int month, const int startday, const bool leap)

{
//define arrays
//declare three variables?

string monthArray[13]= {“null”, “January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December” };

int daysArr[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

//check leap year
if (bool leap=true && int month== 2)
cout <<daysArr[2]=29;
//print out month/ week
//for loop comes in when to stop printing numbers

cout<< MonthArray[month];
cout<< "Sun Mon Tue Wed Thu Fri Sat" << endl;
cout << setw (10) << daysArr<< endl;
// start day
//if (const int startday== 0)
//cout ???
for (int index=1; index<= daysofmonth[month]; index++)
{
cout << setw(10) <<index;
if ((index + startday) %7 == 0) cout <<endl;
}

Go noles!
Topic archived. No new replies allowed.