{"id":885,"date":"2026-02-18T20:35:31","date_gmt":"2026-02-19T00:35:31","guid":{"rendered":"http:\/\/stephendavies.org\/cpsc350\/?p=885"},"modified":"2026-02-18T20:35:31","modified_gmt":"2026-02-19T00:35:31","slug":"not-necessarily-bullet-proof","status":"publish","type":"post","link":"http:\/\/stephendavies.org\/cpsc350\/?p=885","title":{"rendered":"Not necessarily bullet-proof"},"content":{"rendered":"<p>For assignment #3, you don&#8217;t have to worry too much about things like &#8220;what if they enter an invalid formatted date?&#8221; &#8220;What if they type &#8216;<tt>bob<\/tt>&#8216; for the number of tickets to purchase?&#8221; Etc. You do need to make sure to properly handle these two errors, though: attempts to (1) an attempt to purchase a ticket when the flight is sold out, and (2) an attempt to purchase a ticket &#8220;in the past.&#8221;<\/p>\n<p>Also, just a heads-up to something I would think would be obvious, but which students have messed up on in the past: if there are no tickets yet sold for a particular day&#8217;s flight, that should <i>not<\/i> stop a user from buying (the first) ticket for that day. If you think about it, it would be ridiculous for your program not to allow that &mdash; you&#8217;d be in an infinite loop, never able to buy tickets for a flight!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For assignment #3, you don&#8217;t have to worry too much about things like &#8220;what if they enter an invalid formatted date?&#8221; &#8220;What if they type &#8216;bob&#8216; for the number of tickets to purchase?&#8221; Etc. You do need to make sure to properly handle these two errors, though: attempts to (1) an attempt to purchase a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[1],"tags":[],"class_list":["post-885","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=\/wp\/v2\/posts\/885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=885"}],"version-history":[{"count":1,"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=\/wp\/v2\/posts\/885\/revisions"}],"predecessor-version":[{"id":886,"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=\/wp\/v2\/posts\/885\/revisions\/886"}],"wp:attachment":[{"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=885"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/stephendavies.org\/cpsc350\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}