### A Simple Calendar

Alright, hey everyone!
This is my first time to try this website out, so sorry if I do something incorrectly!

So, I'm attempting to create a calander using basic C++ concepts.
Honestly, I've only been doing this for about 5 weeks now, and alot of the basics of C++ are still giving me trouble.
Anyway, I'm shooting for creating a calander that takes the user input of the year and what day of the week that specific year starts on then outputs a single year calendar. I know it needs take into account leap years.

This is as far as I've gotten, and I'm just kind of confused as to which step I should take next.

I know I need to somehow take out the month input, because I put that in before I refined my requirements, but I'm not sure how to without losing my leap year equations!

 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768`` ``````#include #include using namespace std; int main() { int month, year; int first_day, n_days; cout << "Enter the year:"; cin >> year; cout << endl; cout << "Enter the month:"; cin >> month; cout << endl; cout << "Enter the first day of the year (1 for Sunday, 2 for Monday, etc.): "; cin >> first_day; switch (month) { case 2: if((year%400==0) || (year%4==0 && year%100 !=0)) n_days = 29; else n_days = 28; break; case 4: case 6: case 9: case 11: n_days = 30; break; case 1: case 3: case 5: case 7: case 8: case 10: case 12: n_days = 31; break; } cout << endl << "Sun\tMon\tTue\tWed\tThr\tFri\tSat\n"; for (int i = 1; i < first_day; i++) { cout << " \t"; } for (int j = 1; j <= n_days; j++) { if (((j + first_day - 2) % 7 == 0) && (j != 1)) cout << endl; cout << j << "\t"; } cout << endl << endl; return 0; }``````
 ``1234567891011121314151617181920212223242526272829303132333435363738394041`` ``````#include #include #include using namespace std; int main(int argc, char** argv) { int day = 1, month = 1, year, k, c, d; string daysOfTheWeekStrings[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; cout << "Please enter a year: "; cin >> year; if (month == 1 || month == 2) { month += 10; year--; } else { month -= 2; } month *= 26; month -= 2; month /= 10; k = year % 100; c = year / 100; d = (k + k / 4 + c / 4 + c * 5 + day + month) % 7; cout << endl << daysOfTheWeekStrings[d]; return 0; } ``````