HW 1 sol - #include <iostream> #include...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
<iostream> #include <fstream> #include <string> using namespace std; int daysInMonth (string month) { if (month == "January" || month == "March" || month == "May" || month == "July" || month == "August" || month == "October" || month == "December" ) return 31; if (month== "February" ) return 28; if (month== "April" || month == "June" || month == "September" || month == "November" ) return 30; else return 100; } int firstDayofMonth (string month) { if (month == "January" ) return 4; if (month== "February" ) return 0; if (month== "March" ) return 0; if (month== "April" ) return 3; if (month== "May" ) return 5; if (month== "June" ) return 1; if (month== "July" ) return 3; if (month== "August" ) return 6; if (month== "September" ) return 2; if (month== "October" ) return 4; if (month== "November" ) return 0; if (month== "December" ) return 2; else return 100; } string file_name(string month) { return month+ ".txt" ; } string nameofday( int day){ if (day==0) return "Sunday" ; if (day==1)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

HW 1 sol - #include &lt;iostream&gt; #include...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online