{"id":1053,"date":"2015-03-25T15:10:28","date_gmt":"2015-03-25T22:10:28","guid":{"rendered":"http:\/\/sites.evergreen.edu\/compcog15\/?page_id=1053"},"modified":"2015-03-25T15:25:23","modified_gmt":"2015-03-25T22:25:23","slug":"form-letter-program","status":"publish","type":"page","link":"https:\/\/sites.evergreen.edu\/compcog15\/classes\/week-1\/march-30\/form-letter-program\/","title":{"rendered":"Form Letter Program"},"content":{"rendered":"<header class=\"entry-header\" style=\"color: #373737\">\n<h4 class=\"entry-title\" style=\"font-style: inherit;color: #000000\">JavaScript Form Letter<\/h4>\n<\/header>\n<div class=\"entry-content\" style=\"color: #373737\">\n<h1 style=\"font-style: inherit;color: #000000\">Form Letter Assignment: You will change the code examples below so your javascript program will ask the user for 5 variables. One of your variables will be a number. After you click on the button, your program will use these 5 variables in a form letter. In addition, you will add or subtract (or any calculation)\u00a0something from your number input and use this new variable in the letter, giving you a total of 6 variables. You will print out a listing of your program as well as a copy of 2 different runs of your program, and submit the papers to me after class on April 12. You should try to do this assignment before class on April 8 to see what you need help with during class. \u00a0See me right away if you have questions. Remember to save different versions of your work and return to a running copy if things get broken. Good luck!<\/h1>\n<div style=\"font-weight: inherit;font-style: inherit\">\n<h4 style=\"font-weight: inherit;font-style: inherit\"><strong style=\"font-style: inherit\"><a style=\"font-weight: inherit;font-style: inherit;color: #1982d1\" href=\"http:\/\/ada.evergreen.edu\/~vanetta\/formletter4.html\">Form Letter with a calculated variable:<\/a><\/strong><\/h4>\n<h4 style=\"font-weight: inherit;font-style: inherit\">You can view the source from the above link, or the code is below. \u00a0You can try to copy and paste this program into notepad, \u00a0Save it as fletter.html \u00a0(or any other name you like with a .html extension) and running the program. \u00a0Try to make changes, but ALWAYS have a working program you can go back to. \u00a0A<\/h4>\n<p>&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;title&gt; Greetings &lt;\/title&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<br \/>\n&lt;h2&gt;Greetings&lt;\/h2&gt;<br \/>\n&lt;p&gt;<br \/>\nEnter your name: &lt;input type=&#8221;text&#8221; id=&#8221;nameBox&#8221; size=12 value=&#8221;&#8221;&gt;<br \/>\nEnter your age: &lt;input type=&#8221;text&#8221; id=&#8221;ageid&#8221; size=12 value=&#8221;&#8221;&gt;<br \/>\n&lt;\/p&gt;<br \/>\n&lt;input type=&#8221;button&#8221; value=&#8221;Click for Greeting&#8221;<br \/>\nonclick=&#8221;name = document.getElementById(\u2018nameBox\u2019).value;<br \/>\nage = document.getElementById(\u2018ageid\u2019).value;<br \/>\nnextyear = parseFloat(age) + 1;<\/p>\n<p>document.getElementById(\u2018outputDiv\u2019).innerHTML=<br \/>\n\u2018Hello \u2018 + name +<br \/>\n\u2018, welcome to my page.&lt;br&gt;Do you mind if I call you \u2018 +<br \/>\nname + \u2018?\u2019+ \u2018 I hear you are \u2018 +<br \/>\nage + \u2018 years old. Next year you will be \u2018 + nextyear + \u2018 years old.\u2019&#8221;&gt;<br \/>\n&lt;hr&gt;<br \/>\n&lt;div id=&#8221;outputDiv&#8221;&gt;&lt;\/div&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<h4 style=\"font-weight: inherit;font-style: inherit\">Where we are headed.. \u00a0 Below is a link to the tic-tac-toe Javascript code you will finish so that you will teach the computer to play and win at tic-tac-toe \u00a0(OK.. sometimes a draw..) \u00a0Run and take a look at it now, if you like:<\/h4>\n<h4 style=\"font-weight: inherit;font-style: inherit\"><a style=\"font-weight: inherit;font-style: inherit;color: #1982d1\" href=\"http:\/\/academic.evergreen.edu\/v\/vanetta\/tttoutput4.html\">Tic Tac Toe Example:<\/a><\/h4>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript Form Letter Form Letter Assignment: You will change the code examples below so your javascript program will ask the user for 5 variables. One of your variables will be a number. After you click on the button, your program will use these 5 variables in a form letter. In addition, you will add or [&hellip;]<\/p>\n","protected":false},"author":274,"featured_media":0,"parent":1025,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"_mi_skip_tracking":false},"_links":{"self":[{"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/pages\/1053"}],"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=1053"}],"version-history":[{"count":0,"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/pages\/1053\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/pages\/1025"}],"wp:attachment":[{"href":"https:\/\/sites.evergreen.edu\/compcog15\/wp-json\/wp\/v2\/media?parent=1053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}