{"id":3732,"date":"2019-09-01T00:01:16","date_gmt":"2019-09-01T07:01:16","guid":{"rendered":"https:\/\/c-for-dummies.com\/blog\/?p=3732"},"modified":"2019-09-08T07:50:02","modified_gmt":"2019-09-08T14:50:02","slug":"next-tuesday","status":"publish","type":"post","link":"https:\/\/c-for-dummies.com\/blog\/?p=3732","title":{"rendered":"Next Tuesday"},"content":{"rendered":"<p>What&#8217;s today?<\/p>\n<p>The reply could be the day of a week, such as Sunday. That&#8217;s how I first answer the question. The more detailed answer is the day of the month, which isn&#8217;t often on my mind &mdash; unless it&#8217;s an important day like a birthday or some event.<br \/>\n<!--more--><br \/>\nToday is Sunday, September 1st. (I didn&#8217;t need to look it up because I scheduled this post to appear on Sunday, September 1st.) But what about next Tuesday? What date will it be?<\/p>\n<p>Doing the math on my fingers: Monday the 2nd, Tuesday the 3rd. Next Tuesday will be the 3rd. That was easy. But if today were September 26th, a Thursday, what will the following Tuesday be? Quick!<\/p>\n<p>Don&#8217;t worry about using your fingers or remembering which months have 31 days. You can code a program in C that does all the heavy lifting for you. In fact, that&#8217;s the goal of this month&#8217;s Exercise: Write code that takes today&#8217;s date and calculates the date for next Tuesday.<\/p>\n<p>Here&#8217;s a sample run:<\/p>\n<p><code>Today is Sunday the 1st.<br \/>\nNext Tuesday will be the 3rd.<\/code><\/p>\n<p>And if today is Tuesday, the program looks a week ahead:<\/p>\n<p><code>Today is Tuesday the 27th.<br \/>\nNext Tuesday is the 3rd.<\/code><\/p>\n<p>The code must recognize the end of the month &mdash; and the end of the year &mdash; then calculate the date for the following Tuesday accordingly.<\/p>\n<p>Please try coding this Exercise on your own before you check out <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=3741\">my solution<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What will the date be next Tuesday? <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=3732\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-3732","post","type-post","status-publish","format-standard","hentry","category-exercise"],"_links":{"self":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3732"}],"version-history":[{"count":4,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3732\/revisions"}],"predecessor-version":[{"id":3758,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3732\/revisions\/3758"}],"wp:attachment":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}