Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i see 1 hickup
- some month have 30 days, others 31
- i see that as being the biggest obstacle of your assignment
- general guidelines are:
- for (months =0; months <= 11; months++)
- {
- if (month == 0)
- cout << "January" << endl;
- else if (month == 1)
- cout << "February" << endl;
- ...
- cout << "Sun Mon Tue Wed Thu Fri Sat" << endl;
- INT switchLineCounter = 0; //when this value reaches 6, you cout << endl; so that the starts again on a sunday
- for (days =0; days <= 31; days++)
- {
- if (switchLineCounter == 6)
- cout << endl;
- if ( (month == feburary || month == april || month == june || month == september || month == november ) && days == 30 )
- break;
- else
- {
- cout << days << " ";
- switchLineCounter++;
- }
- }
- cout << endl << endl << endl;
- }
Add Comment
Please, Sign In to add comment