{"id":708,"date":"2010-03-05T23:18:19","date_gmt":"2010-03-05T23:18:19","guid":{"rendered":"https:\/\/kweaver.org\/cs\/ap-tutoring-session-strings\/"},"modified":"2010-03-05T23:18:19","modified_gmt":"2010-03-05T23:18:19","slug":"ap-tutoring-session-strings","status":"publish","type":"post","link":"https:\/\/kweaver.org\/cs\/ap-tutoring-session-strings\/","title":{"rendered":"AP Tutoring Session &#8211; Strings"},"content":{"rendered":"<p><a href=\"http:\/\/www.kweaver.org\/.a\/6a00e54eea8ed988340120a90773df970b-pi\"><\/a>&#0160;Okay, this is the only way I&#39;m going to prep.<\/p>\n<p>Tomorrow, I am covering an AP Free Response question at our Super Saturday Tutorial Session.<\/p>\n<p>It&#39;s called String Coder. <a href=\"http:\/\/www.kweaver.org\/.a\/6a00e54eea8ed9883401310f6e1fd2970c-pi\"><img decoding=\"async\" alt=\"2010-03-05_2302\" border=\"0\" class=\"asset asset-image at-xid-6a00e54eea8ed9883401310f6e1fd2970c image-full \" src=\"http:\/\/www.kweaver.org\/.a\/6a00e54eea8ed9883401310f6e1fd2970c-800wi\" style=\"DISPLAY: block; MARGIN-LEFT: auto; MARGIN-RIGHT: auto\" title=\"2010-03-05_2302\" \/><\/a>&#0160;<br \/>I&#39;ve pulled the things I think they need from the Quick Reference, String class, List and some code from the Grid World does a for each.<\/p>\n<p>They get a String Coder class they can use.<\/p>\n<p>They have to do the following:<\/p>\n<p><font face=\"Times-Roman\" size=\"3\"><font face=\"Times-Roman\" size=\"3\"><\/p>\n<p style=\"text-align: left\"><a href=\"http:\/\/www.kweaver.org\/.a\/6a00e54eea8ed9883401310f6e3578970c-pi\"><img decoding=\"async\" alt=\"2010-03-05_2313\" border=\"0\" class=\"asset asset-image at-xid-6a00e54eea8ed9883401310f6e3578970c image-full \" src=\"http:\/\/www.kweaver.org\/.a\/6a00e54eea8ed9883401310f6e3578970c-800wi\" style=\"DISPLAY: block; MARGIN-LEFT: auto; MARGIN-RIGHT: auto\" title=\"2010-03-05_2313\" \/><\/a> <\/p>\n<p><\/font><\/font> <font face=\"Courier\" size=\"3\"><font face=\"Courier\" size=\"3\"><\/p>\n<p style=\"text-align: left\">&#0160;<\/p>\n<p><\/font><\/font><\/p>\n<p>I always have them write the return stuff first, as that will give some points.<\/p>\n<p>&#0160;&#0160;&#0160; String result = &quot;&quot;;<\/p>\n<p>&#8230;<\/p>\n<p>&#0160;&#0160;&#0160; return result;<\/p>\n<p>Then I am going to have them figure out how to meet the post condition.<\/p>\n<p>\tfor (StringPart part : parts)<\/p>\n<p>&#0160;&#0160; {<\/p>\n<p>\t&#0160;&#0160;&#0160; int start = part.getStart();<\/p>\n<p>\t&#0160;&#0160;&#0160; int length = part.getLength();<\/p>\n<p>&#0160;&#0160;&#0160; &#0160;&#0160; result += masterString.substring(start, start+length);<\/p>\n<p>&#0160;&#0160; }<\/p>\n<p>Next they have to do:<\/p>\n<p><a href=\"http:\/\/www.kweaver.org\/.a\/6a00e54eea8ed9883401310f6e31aa970c-pi\"><img decoding=\"async\" alt=\"2010-03-05_2311\" border=\"0\" class=\"asset asset-image at-xid-6a00e54eea8ed9883401310f6e31aa970c image-full \" src=\"http:\/\/www.kweaver.org\/.a\/6a00e54eea8ed9883401310f6e31aa970c-800wi\" style=\"DISPLAY: block; MARGIN-LEFT: auto; MARGIN-RIGHT: auto\" title=\"2010-03-05_2311\" \/><\/a> <br \/> Again, first we have to return an ArrayList of String Part:<\/p>\n<p>ArrayList&lt;StringPart&gt; result = new ArrayList&lt;StringPart&gt;();<\/p>\n<p>and <\/p>\n<p>return result.<\/p>\n<p>In the middle (instead of and).<\/p>\n<p>They have to go through the word, searching the parts of the master string <\/p>\n<p>while (word.length() &gt; 0)<\/p>\n<p>{<\/p>\n<p>&#0160;&#0160;&#0160; StringPart part = findPart(word);&#0160;&#0160; (they will find it according to the pre-condition)<\/p>\n<p>&#0160;&#0160;&#0160; result.add(part);<\/p>\n<p>&#0160;&#0160;&#0160; word = word.substring(part.getLength());<\/p>\n<p>}<\/p>\n<p><\/p>\n<p>I&#39;m going to have them give me the answers, I&#39;m going to type the code in and see if it works.&#0160; If it doesn&#39;t, I&#39;m going to have them debug it.<\/p>\n<p>I do have code to try.<\/p>\n<p>If we run out of time, I&#39;ll teach them how to program the XBox.&#0160; The other AP teachers will probably kill me.<\/p>\n<p><\/p>\n<p><font size=\"3\"><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#0160;Okay, this is the only way I&#39;m going to prep. Tomorrow, I am covering an AP Free Response question at our Super Saturday Tutorial Session. It&#39;s called String Coder. &#0160;I&#39;ve pulled the things I think they need from the Quick Reference, String class, List and some code from the Grid World does a for each. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-708","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts\/708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/comments?post=708"}],"version-history":[{"count":0,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts\/708\/revisions"}],"wp:attachment":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/media?parent=708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/categories?post=708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/tags?post=708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}