This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user:acrowle1:portfolio:cprogproject4 [2014/03/10 02:34] – [Code] acrowle1 | user:acrowle1:portfolio:cprogproject4 [2014/03/23 16:58] (current) – [Reflection] acrowle1 | ||
---|---|---|---|
Line 11: | Line 11: | ||
**Resources: | **Resources: | ||
* http:// | * http:// | ||
+ | * http:// | ||
* project assignment page | * project assignment page | ||
* consultation with C/C++ programming instructor, Matt Haas | * consultation with C/C++ programming instructor, Matt Haas | ||
Line 67: | Line 68: | ||
if(year%4==0&& | if(year%4==0&& | ||
printf(" | printf(" | ||
- | | + | if(i==1&& |
printf(" | printf(" | ||
- | | + | if(i==2&& |
printf(" | printf(" | ||
- | | + | if(i==3&& |
printf(" | printf(" | ||
- | | + | if(i==4&& |
printf(" | printf(" | ||
- | if(i==5&& | + | if(i==5&& |
printf(" | printf(" | ||
- | | + | if(i==6&& |
printf(" | printf(" | ||
- | | + | if(i==7&& |
printf(" | printf(" | ||
- | | + | if(i==0&& |
printf(" | printf(" | ||
+ | |||
//not leap years! | //not leap years! | ||
Line 114: | Line 116: | ||
=====Execution===== | =====Execution===== | ||
- | Again, if there is associated code with the project, and you haven' | + | |
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Hello, World! | + | lab46:~/src/ |
- | lab46: | + | lab46: |
+ | Type last two digits of year from 2001-2099; | ||
+ | 04 | ||
+ | year, 2004, is a leap year | ||
+ | Jan 1st, 2004, is on: Thursday | ||
+ | lab46: | ||
+ | January 2004 | ||
+ | Su Mo Tu We Th Fr Sa | ||
+ | | ||
+ | | ||
+ | 11 12 13 14 15 16 17 | ||
+ | 18 19 20 21 22 23 24 | ||
+ | 25 26 27 28 29 30 31 | ||
+ | |||
+ | lab46: | ||
+ | Type last two digits of year from 2001-2099; | ||
+ | 67 | ||
+ | Jan 1st, 2067, is on: Saturday | ||
+ | lab46: | ||
+ | January 2067 | ||
+ | Su Mo Tu We Th Fr Sa | ||
+ | 1 | ||
+ | | ||
+ | 9 10 11 12 13 14 15 | ||
+ | 16 17 18 19 20 21 22 | ||
+ | 23 24 25 26 27 28 29 | ||
+ | 30 31 | ||
</ | </ | ||
=====Reflection===== | =====Reflection===== | ||
- | Comments/ | + | Interestingly enough, |
+ | The criteria: | ||
+ | - If year is evenly divisible by 4, it is a leap year. | ||
+ | - If year is evenly divided by 100, it is not a leap year, except when | ||
+ | - the year is also evenly divisible by 400. | ||
+ | The year 2000 is a significant calendar year because it was the first instance when the third criteria was invoked since switching from the Julian calendar to the Gregorian one. The reason for leap years? This was necessary to keep our calendar in alignment with Earth' | ||
+ | |||
+ | While I wrote my code more simplistically saying if i divided by 4 equals zero, then it is a leap year and if i divided by 4 does not equal zero, not a leap year, the code worked. I could have added that i/100==0 || i/400==0 is a leap year to make my code more realistic to how the calendar interprets leap years from non-leap years, particularly in special instances such as 2000. | ||
=====References===== | =====References===== | ||
In performing this project, the following resources were referenced: | In performing this project, the following resources were referenced: | ||
- | * URL1 | + | * http:// |
- | * URL2 | + | * http:// |
- | * URL3 (provides useful information on topic) | + | * [[haas: |
- | * URL4 | + | |
- | Generally, state where you got informative and useful information to help you accomplish this project when you originally worked on it (from Google, other wiki documents on the Lab46 wiki, etc.) |