journal:spring2020:jsinger2:week4

This shows you the differences between two versions of the page.

journal:spring2020:jsinger2:week4 [2020/02/06 07:03] 127.0.0.1 external edit |
journal:spring2020:jsinger2:week4 [2020/02/12 23:58] (current) jsinger2 |
||
---|---|---|---|

Line 1: | Line 1: | ||

=====cprog week4===== | =====cprog week4===== | ||

---- | ---- | ||

- | ====MONTH Day, YEAR==== | + | ====February 12, 2020==== |

- | Filler text- your entry goes here; remove this line to receive full credit. | + | This week was a pretty easy week. The long division puzzle was not that difficult. It took some time to get started, but once I found one value the rest followed quickly. |

+ | Dow0 was also not very difficult. Having already taking a few coding classes, most of the principles need to solve the problem I was already familiar with. The one problem I ran into was the year 2000. To determine the day of the week, I took the sum of the last two digits and the 25% value and I divided it by 7 then multiplied it by 7 again. Since the variable is an integer it would disregard the decimal. This method works for every year except the year 2000. I know how this year would work with the method provided in the assignment, 200 is a leap year so the result number would be -1, and the largest multiple of 7 that could fit would be negative 7, so -1-(-7) would be 6, Saturday. The problem with this is that if I wanted to incorporate this into every year I would have to do an if statement for every multiple of 7 up to 98. This method would work but it would be inefficient. So I solved this by simply making an if statement specifically for the year 2000. I probably could' |

journal/spring2020/jsinger2/week4.txt · Last modified: 2020/02/12 23:58 by jsinger2

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International