{"id":766,"date":"2014-04-17T22:07:17","date_gmt":"2014-04-17T22:07:17","guid":{"rendered":"http:\/\/blogs.evergreen.edu\/candc14\/?page_id=766"},"modified":"2015-04-13T11:57:23","modified_gmt":"2015-04-13T18:57:23","slug":"movie-program","status":"publish","type":"page","link":"https:\/\/sites.evergreen.edu\/compcog15\/communications-2\/forums\/classes\/april-19\/movie-program\/","title":{"rendered":"Movie Program"},"content":{"rendered":"<h1>Movie Program<\/h1>\n<div>\n<p>Run then study carefully the code for\u00a0<a href=\"http:\/\/ada.evergreen.edu\/~vanetta\/Movie1.html\">Movie<del><\/del><\/a><\/p>\n<p>You task it to make sure you can run this program on your machine, then make the following changes to it:<\/p>\n<p>1.\u00a0 Before determining the price of the ticket, ask if the user has a $1 off coupon.\u00a0 If they do, then give them a dollar off the price<\/p>\n<p>2.\u00a0 Once that works,\u00a0 add a third value.\u00a0 Ask if it is Wednesday.\u00a0 Tickets are half price on Wednesday from the lowest price.\u00a0 See if you can write code that correctly figures the correct price of the ticket:<\/p>\n<p>For example,\u00a0\u00a0 An adult with a coupon on Wednesday would pay $3.50\u00a0 (8-1\/2)<br \/>\nA student without a coupon on Wednesday would pay $2.50\u00a0 (5-0\/2)<br \/>\nAn adult with a coupon on Friday would pay $7\u00a0 (8-1)<br \/>\nA kid is always free<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;html&gt;<br \/>\n&lt;!&#8211; Demo of using and (&amp;&amp;) to check conditions&#8211;&gt;<br \/>\n&lt;body&gt;<\/p>\n<p>&lt;script type=&#8221;text\/javascript&#8221;&gt;<\/p>\n<p>ttype = prompt(&#8220;Enter adult,student, or kid&#8221;,&#8221;adult&#8221;);<br \/>\ncoupon = prompt(&#8220;Do you have a coupon&#8221;,&#8221;no&#8221;);<br \/>\nwed = prompt(&#8220;Is is Wednesday&#8221;,&#8221;no&#8221;);<\/p>\n<p>if (ttype == &#8220;adult&#8221; &amp;&amp; coupon == &#8220;yes&#8221; &amp;&amp; wed == &#8220;yes&#8221;) {<br \/>\ndocument.write(&#8220;that will be $3.50 please.&#8221;);<br \/>\n}<\/p>\n<p>&lt;\/script&gt;<\/p>\n<p>&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<table style=\"letter-spacing: normal;text-indent: 0px\">\n<tbody>\n<tr>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<tr>\n<td class=\"line-number\"><\/td>\n<td class=\"line-content\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Movie Program Run then study carefully the code for\u00a0Movie You task it to make sure you can run this program on your machine, then make the following changes to it: 1.\u00a0 Before determining the price of the ticket, ask if the user has a $1 off coupon.\u00a0 If they do, then give them a dollar [&hellip;]<\/p>\n","protected":false},"author":274,"featured_media":0,"parent":556,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_mi_skip_tracking":false},"_links":{"self":[{"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/pages\/766"}],"collection":[{"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/users\/274"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/comments?post=766"}],"version-history":[{"count":0,"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/pages\/766\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/pages\/556"}],"wp:attachment":[{"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/media?parent=766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}