{"id":3060,"date":"2017-05-17T13:41:41","date_gmt":"2017-05-17T20:41:41","guid":{"rendered":"https:\/\/sites.evergreen.edu\/compcog17\/?page_id=3060"},"modified":"2017-05-17T13:41:41","modified_gmt":"2017-05-17T20:41:41","slug":"write-code-practice","status":"publish","type":"page","link":"https:\/\/sites.evergreen.edu\/compcog17\/write-code-practice\/","title":{"rendered":"Write Code Practice"},"content":{"rendered":"<h2>Write a JavaScript Program to get scores until the user eters a score over 100. For each score entered, if the score is less than 60 and even, tell the user that fact and get this person&#8217;s name. When you exit, print the number of odd scores over 80, the highest score less than 70, and the average of all the scores in the 80s.<\/h2>\n<h2><\/h2>\n<h2>var eventotal = evencount = highodd = eightycount = 0;<\/h2>\n<h2>testscore = prompt(&#8220;enter the first test score&#8221;,&#8221;&#8221;);<br \/>\ntestscore = parseInt(testscore);<br \/>\nwhile (testscore &lt;= 100 )<br \/>\n{<br \/>\nif ((testscore&lt; 60) &amp;&amp; (testscore%2 == 0))<br \/>\n{<br \/>\ndocument.write(&#8220;this even score is less than 60&#8221; + &#8220;&lt;p&gt;&#8221;);<br \/>\nname = prompt(&#8220;what is this persons name?&#8221;,&#8221;&#8221;);<br \/>\n}<\/h2>\n<h2>if ((testscore % 2) == 1) &amp;&amp; (testscore &gt; 80) )<br \/>\n{<br \/>\ncount = count + 1;<br \/>\n}<\/h2>\n<h2>if (testscore &lt; 70)<br \/>\n{<br \/>\nif (testscore&gt;high)<br \/>\n{<br \/>\nhigh = testscore;<br \/>\n}<br \/>\n}<\/h2>\n<h2>if ((testscore &gt; 79) &amp;&amp; (testscore &lt; 90))<br \/>\n{<br \/>\nec = ec + 1;<br \/>\nesum = esum + testscore;<br \/>\n}<\/h2>\n<h2>testscore = prompt(&#8220;enter the next test score or 0 to exit&#8221;,&#8221;&#8221;);<br \/>\ntestscore = parseInt(testscore);<br \/>\n}<\/h2>\n<h2>document.write(&#8220;the number of odd scores over 80 is &#8221; + count + &#8220;&lt;p&gt;&#8221;);<br \/>\ndocument.write(&#8220;the highest score less than 70 is &#8221; + high + &#8220;&lt;p&gt;&#8221;);<br \/>\ndocument.write(&#8220;the average score in the 80s is &#8221; + esum\/ec + &#8220;&lt;p&gt;&#8221;);<\/h2>\n<h2>&lt;\/script&gt;<\/p>\n<p>&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Write a JavaScript Program to get scores until the user eters a score over 100. For each score entered, if the score is less than 60 and even, tell the user that fact and get this person&#8217;s name. When you exit, print the number of odd scores over 80, the highest score less than 70, [&hellip;]<\/p>\n","protected":false},"author":274,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_mi_skip_tracking":false},"_links":{"self":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages\/3060"}],"collection":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/users\/274"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/comments?post=3060"}],"version-history":[{"count":0,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages\/3060\/revisions"}],"wp:attachment":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/media?parent=3060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}