<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9006965196529766208</id><updated>2012-02-13T14:38:40.162-05:00</updated><category term='problem solving'/><category term='algorithm'/><title type='text'>ICS3M Canterbury</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-1259112510155702254</id><published>2009-01-04T13:46:00.002-05:00</published><updated>2009-01-04T13:48:46.586-05:00</updated><title type='text'>Summative Level 4 Data File ERROR</title><content type='html'>To quote the (not quite) immortal Britney - Oops, I did it again!&lt;br /&gt;&lt;br /&gt;There's an error with the &lt;span style="font-family: courier new; font-weight: bold;"&gt;Level4ShippingRates.txt&lt;/span&gt; data file. I've corrected it and posted the corrected version under both the original and a modified name (to signal to people not reading the blog that they should grab a new version).&lt;br /&gt;&lt;br /&gt;Please get and use the new version of the file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-1259112510155702254?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/1259112510155702254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=1259112510155702254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/1259112510155702254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/1259112510155702254'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2009/01/summative-level-4-data-file-error.html' title='Summative Level 4 Data File ERROR'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-3641280611460873678</id><published>2009-01-01T14:16:00.002-05:00</published><updated>2009-01-01T14:21:39.726-05:00</updated><title type='text'>Summative Level 3 Data File ERROR - Oops!</title><content type='html'>My bad e/one. There's an error (which I've just corrected) in the data file for the level 3 Summative. The file is called &lt;span style="font-family: courier new; font-weight: bold;"&gt;Level3InvoiceInformation.txt&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The error was that there was no colon separating the city from the province in the Header lines and this would have made it impossible to separate out the city from the province. You need to be able to process the province in order to correctly calculate the PST.&lt;br /&gt;&lt;br /&gt;There are two files there now - &lt;span style="font-family: courier new; font-weight: bold;"&gt;Level3InvoiceInformation.txt&lt;/span&gt; and &lt;span style="font-family: courier new; font-weight: bold;"&gt;Level3InvoiceInformation_v2_UseMe.txt&lt;/span&gt;. They are identical and you can use either one. I have two copies to signal the change to anyone not reading the blog.&lt;br /&gt;&lt;br /&gt;Once again, my apologies for the error. I hope it didn't really foul anyone up and that you were able to fix it yourself if so.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-3641280611460873678?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/3641280611460873678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=3641280611460873678' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3641280611460873678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3641280611460873678'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2009/01/summative-level-3-data-file-error-oops.html' title='Summative Level 3 Data File ERROR - Oops!'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-6716507665095072607</id><published>2008-12-20T09:02:00.002-05:00</published><updated>2008-12-20T09:05:02.481-05:00</updated><title type='text'>Summative Data Files Updated</title><content type='html'>I've modified all the summative data files so that the fields in each record are separated by ":".  For example an address might look like: "124 Main St.:K1K 0N7:Ottawa:ON"&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The end of line problems should also be solved, now.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-6716507665095072607?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/6716507665095072607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=6716507665095072607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/6716507665095072607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/6716507665095072607'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/12/summative-data-files-updated.html' title='Summative Data Files Updated'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-7396234713555790641</id><published>2008-12-12T16:25:00.002-05:00</published><updated>2008-12-12T16:37:57.035-05:00</updated><title type='text'>Homework</title><content type='html'>There's homework (that I'll be checking) for the weekend.&lt;br /&gt;&lt;br /&gt;You must have completed (or demonstrate a good faith effort) both of the &lt;span style="font-weight: bold;"&gt;linear search&lt;/span&gt; exercises on the 2nd handout. (This is the handout that says Array Exercises in the header and that has the filename &lt;span style="font-family: courier new;"&gt;ICS3M_2.25_Exercise.doc&lt;/span&gt; in the footer.)&lt;br /&gt;&lt;br /&gt;If you are one of the people who had already finished then you must do &lt;span style="font-style: italic;"&gt;one&lt;/span&gt; of exercises 1, 3, 4, or 8 at the end of Chapter 10 in the text.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-7396234713555790641?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/7396234713555790641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=7396234713555790641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/7396234713555790641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/7396234713555790641'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/12/homework.html' title='Homework'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-7928848107578015904</id><published>2008-12-12T16:13:00.002-05:00</published><updated>2008-12-12T16:25:20.906-05:00</updated><title type='text'>Make Up Test</title><content type='html'>Heads up the couple of people who weren't in class today. I handed back the tests. Not everyone passed. If you got less than 60% you can do a re-test (different content) next Wednesday the 17th of December in class. &lt;br /&gt;&lt;br /&gt;Here's the deal, though. The maximum mark you can get on the re-test is 60%. It wouldn't otherwise be fair to people above the 60% cutoff line if one could blow the original and then do a re-test and get a better mark than them.&lt;br /&gt;&lt;br /&gt;You have to let me know by Monday if you want to do the re-test on Monday.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-7928848107578015904?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/7928848107578015904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=7928848107578015904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/7928848107578015904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/7928848107578015904'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/12/make-up-test.html' title='Make Up Test'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-3124651170443545650</id><published>2008-12-06T08:03:00.000-05:00</published><updated>2008-12-06T08:04:56.355-05:00</updated><title type='text'>Facebook virus</title><content type='html'>I'm seeing &lt;a href="http://www.blogger.com/post-create.g?blogID=9006965196529766208"&gt;credible reports&lt;/a&gt; about a virus spreading via facebook's messaging system. The subject line in an infected message is something like "You look awesome in this new movie". When you click the link you get prompted to upgrade your flash player. At this point malicious s/ware is installed on your computer. The software turns your computer into a (cyber) zombie that will then participate in net attacks against other sites against your will.&lt;br /&gt;&lt;br /&gt;Forewarned is forearmed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-3124651170443545650?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/3124651170443545650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=3124651170443545650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3124651170443545650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3124651170443545650'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/12/facebook-virus.html' title='Facebook virus'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-8914259669331862795</id><published>2008-11-17T09:06:00.000-05:00</published><updated>2008-11-17T12:52:58.457-05:00</updated><title type='text'>I Need A Raise</title><content type='html'>That should be "I need arrays".&lt;br /&gt;&lt;br /&gt;Today we're tackling arrays. If you missed class then the homework will help you catch up.&lt;br /&gt;&lt;br /&gt;Read Ch. 10, pp 237-241. Then do Questions 1, 2, 3, 4 and 14a, 14b, 14c, and, 14d.&lt;br /&gt;&lt;br /&gt;Note that question 4 asks you to write a &lt;span style="font-family:courier new;"&gt;for-each&lt;/span&gt; statement but it turns out that J# hasn't implemented the for-each statement. (D'oh!)Use a regular &lt;span style="font-family:courier new;"&gt;for &lt;/span&gt;statement instead.&lt;br /&gt;&lt;br /&gt;You should note that I've put a sample program that I wrote in class showing an array of strings being used in a for loop in the ICS3M\Arrays Handout folder. In addition, you can also find the powerpoint presentation for Arrays in that same folder. Make sure you look at the presentation in Notes view mode so you can see my notes which augment the information in the slides. I don't recommend that you try and rely on the slides alone without reading the text. There's a &lt;span style="font-style: italic;"&gt;lot &lt;/span&gt;more information in the text that can be found in the slides.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-8914259669331862795?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/8914259669331862795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=8914259669331862795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/8914259669331862795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/8914259669331862795'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/11/i-need-raise.html' title='I Need A Raise'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-7554002643864032870</id><published>2008-11-12T12:23:00.001-05:00</published><updated>2008-11-12T12:25:35.689-05:00</updated><title type='text'>J# software download site</title><content type='html'>Some people have asked me to re-link to the download site for the J# software. Here it is:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/express/2005/download/default.aspx"&gt;http://www.microsoft.com/express/2005/download/default.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-7554002643864032870?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/7554002643864032870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=7554002643864032870' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/7554002643864032870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/7554002643864032870'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/11/j-software-download-site.html' title='J# software download site'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-2676545945822799336</id><published>2008-11-10T09:12:00.000-05:00</published><updated>2008-11-10T12:08:58.800-05:00</updated><title type='text'>Assignment 2</title><content type='html'>Reminder: This is due on Thursday. For Homework today, I want you to write the pseudocode for &lt;span style="font-family:courier new;"&gt;evaluateBet()&lt;/span&gt;. In your pseudocode write:&lt;br /&gt;&lt;ol&gt;&lt;li&gt; the actual method declaration,&lt;br /&gt;&lt;/li&gt;&lt;li&gt;the inputs and what their possible values are&lt;br /&gt;&lt;/li&gt;&lt;li&gt;and the output(s)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;the algorithm for executing/implementing &lt;span style="font-family:courier new;"&gt;evaluateBet()'&lt;/span&gt;s problem solution.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-2676545945822799336?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/2676545945822799336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=2676545945822799336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/2676545945822799336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/2676545945822799336'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/11/assignment-2.html' title='Assignment 2'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-6842791485468475787</id><published>2008-11-06T22:11:00.001-05:00</published><updated>2008-11-06T22:32:55.460-05:00</updated><title type='text'></title><content type='html'>We did some basics review over the past couple of days in an attempt to solidify students' skills. Here's what we did:&lt;br /&gt;&lt;br /&gt;Consider:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;for(int i=0;i&lt;=20;i++)&lt;br /&gt;   System.out.println(i); &lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;for(int i=45;i&gt;=-5; i-=5)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   System.out.println(i);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Identify:&lt;br /&gt;1.    the loop control variable&lt;br /&gt;2.    the initialization code&lt;br /&gt;3.    exit condition&lt;br /&gt;4.    increment statement&lt;br /&gt;5.    executable satement(s)&lt;br /&gt;6.    what output will be produced?&lt;br /&gt;&lt;br /&gt;We filled out the || and &amp;amp;&amp;amp; and ! truth tables&lt;br /&gt;&lt;br /&gt;Given:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;do&lt;br /&gt;PUT Prompt for usrNum&lt;br /&gt;GET usrNum&lt;br /&gt;//while usrNum is out of range&lt;br /&gt;while(usrNum&gt;10 || usrNum &lt;1)&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;-there is at least 1 other way to re-write this while condtion. What is it?&lt;br /&gt;&lt;br /&gt;and there's also....&lt;br /&gt;&lt;br /&gt;Given:&lt;br /&gt;Loop control variable (i.e. counter): &lt;span style="font-family:courier new;"&gt;index&lt;/span&gt;&lt;br /&gt;Executable stmt: &lt;span style="font-family:courier new;"&gt;finalValue: -= index;&lt;/span&gt;&lt;br /&gt;increment statement: &lt;span style="font-family:courier new;"&gt;index++;&lt;/span&gt;&lt;br /&gt;initialization statement: &lt;span style="font-family:courier new;"&gt;index = 1;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Write the for loop that implements these conditions.&lt;br /&gt;&lt;br /&gt;Assume that &lt;span style="font-family:courier new;"&gt;finalValue&lt;/span&gt; has itself been intialized to a value of 7, what output would be produced by the following line of code assuming it came directly after the for loop exited.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;System.out.println(“The final value is “ + finalValue);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Also&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;if (quantityPurchased &gt;= 150 &amp;amp;&amp;amp; price &gt; 9.99)&lt;br /&gt; discount = .05;&lt;br /&gt;else if (quantityPurchased &gt;= 1000 &amp;amp;&amp;amp; price &gt; 7.99)&lt;br /&gt; discount = .1;&lt;br /&gt;else if (quantityPurchased &gt;= 10000 || price &lt; discount =" .33;" discount =" 1;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Answer the following questions:&lt;br /&gt;1. What discount will be applied if I buy 175 items at a price of $8.00?&lt;br /&gt;2. What discount will be applied if I buy 225 items at a price of $10.29?&lt;br /&gt;3. What discount will be applied if I buy 50 items at $0.99?&lt;br /&gt;4. What discount will be applied if I buy 1500 items at $11.99?&lt;br /&gt;5. What discount will be applied if I buy 1500 items at $6.99?&lt;br /&gt;&lt;br /&gt;I'll post the answers in the comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-6842791485468475787?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/6842791485468475787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=6842791485468475787' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/6842791485468475787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/6842791485468475787'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/11/we-did-some-basics-review-over-past.html' title=''/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-4963388788267584522</id><published>2008-11-05T13:09:00.000-05:00</published><updated>2008-11-05T13:40:47.161-05:00</updated><title type='text'>Quantity is Quality (sometimes)</title><content type='html'>Yesterday's and today's class have been mostly devoted towards reviewing some fundamentals since I'd sensed a weakness in quite a few students. I'm going to continue with that tomorrow and, aside from some notes on documenting methods, am not planning on introducing any more new material this week.  I think the fundamental weakness is that the class hasn't written enough code for the basic constructs to be at your fingertips. Once you've written a hundred for loops you won't be struggling with how to put one together anymore.&lt;br /&gt;&lt;br /&gt;Quantity is (can lead to?) quality. It's like martial arts. You practice the same move over and over and over again. You do the same thing a thousand, two thousand times. The point? To insert the moves into your nervous system. To make this artificial sequence of moves something that you do automatically, instinctively. Once you reach that level of integration then you can start improvising with the moves and do creative things with them.&lt;br /&gt;&lt;br /&gt;Computer Science, then, as a form of mental &lt;span style="font-style: italic;"&gt;karate&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The other big challenge that a lot of students are facing right now has to do with the difficulty of translating the requirements laid out in the review exercises into a solution implemented in the code. It's like word problems in math. You have to keep practicing the process of turning the descriptions into java code. How do you this if you don't already know how to do it? That's the sixty-four thousand dollar question.&lt;br /&gt;&lt;br /&gt;One part of the answer is to write some *&amp;amp;(@#$ stuff down. The program description contain pieces of the puzzle you have to put together. Get them out of your head (where they reside after you read the problem) and onto some paper so you can look at them.&lt;br /&gt;&lt;br /&gt;Another part of the answer is to do lots of them. Again, practice is going to lead you in the right direction. Every problem that you successfully solve is an approach that enters your repertoire and that you then have available for re-use down the road.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-4963388788267584522?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/4963388788267584522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=4963388788267584522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/4963388788267584522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/4963388788267584522'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/11/quantity-is-quality-sometimes.html' title='Quantity is Quality (sometimes)'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-2366179720555351690</id><published>2008-10-30T10:26:00.001-04:00</published><updated>2008-10-30T10:28:59.783-04:00</updated><title type='text'></title><content type='html'>Heads up! Homework for tomorrow is to implement &lt;span style="font-family:courier new;"&gt;Review:SpanishNumbers&lt;/span&gt; on page 161. If you get stuck try brainstorming and writing stuff down to kick start the design process. Be prepared to show me something even if you don't get it working.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;color:#ff0000;"&gt;No more slacking on the homework!!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-2366179720555351690?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/2366179720555351690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=2366179720555351690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/2366179720555351690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/2366179720555351690'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/10/heads-up-homework-for-tomorrow-is-to.html' title=''/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-164612137315306257</id><published>2008-10-28T15:11:00.001-04:00</published><updated>2008-10-28T15:39:16.083-04:00</updated><title type='text'>There's a madness in his method</title><content type='html'>We started methods today (Ch 07 in your book). You find the PPT presentation that I was running in the handout folder now. It's called &lt;span style="font-weight: bold;font-family:courier new;" &gt;ICS3M_2_Ch07.ppt&lt;/span&gt;. Note that I've included a bunch of stuff in the slide notes so you should view the slide in Notes view.&lt;br /&gt;&lt;br /&gt;On a really general level methods are a way to support modularity in computer software in general and in Object-Oriented programming (of which Java is an example) in particular. Methods are a way of grouping together code that performs a specific/singular function in a way that hides the details of how that function is implemented from the main body of the code and that promotes the reuse of that code. We'll talk about that aspect (the implementation hiding aspect) of methods tomorrow. If I fail to mention this issues please remind me, OK?&lt;br /&gt;&lt;br /&gt;You'll need to know the details of how we actually include, code and call methods in our code.&lt;br /&gt;&lt;br /&gt;Calling methods is easy. You've been doing it all along.  Just put the method name along with any arguments in the brackets in your code and it will be executed under the appropriate circumstances.&lt;br /&gt;&lt;br /&gt;For instance: &lt;span style="font-family:courier new;"&gt;System.Convert.toInt16("3457");&lt;/span&gt; is a method call. So, for that matter, is &lt;span style="font-family:courier new;"&gt;System.out.println("Some kinda textin' goin' on");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For 10 points everybody, how do we know if a piece of code is a method call?&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center; color: rgb(204, 0, 0); font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;IT HAS BRACKETS&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;We also reviewed for loops.&lt;br /&gt;&lt;br /&gt;We remember how a for loop works by&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:180%;" &gt;&lt;br /&gt;I&lt;/span&gt;nteresting&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:180%;" &gt;&lt;br /&gt;C&lt;/span&gt;hallenges&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:180%;" &gt;&lt;br /&gt;E&lt;/span&gt;xcite&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:180%;" &gt;&lt;br /&gt;I&lt;/span&gt;nnovators&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;where&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-family: courier new; font-weight: bold;font-size:180%;" &gt;&lt;br /&gt;I&lt;/span&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; - Initialize the counter&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-family: courier new; font-weight: bold;font-size:180%;" &gt;&lt;br /&gt;C&lt;/span&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; - Check the (exit) condition&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;font-size:180%;"  &gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&lt;br /&gt;E&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; - Execute the body&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-family: courier new; font-weight: bold;font-size:180%;" &gt;&lt;br /&gt;I&lt;/span&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; - Increment the counter&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Be prepared to chant it tomorrow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-164612137315306257?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/164612137315306257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=164612137315306257' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/164612137315306257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/164612137315306257'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/10/theres-madness-in-his-method.html' title='There&apos;s a madness in his method'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-816076419116841739</id><published>2008-10-27T20:49:00.000-04:00</published><updated>2008-10-27T20:56:06.576-04:00</updated><title type='text'>Visual J#</title><content type='html'>A student told me today that he was being prompted for a registration key when he tried to start J# at home. That indicates to me that he had downloaded Microsoft J# Visual Studio Express 2008 rather than Visual Studio Express 2005.  If you're having this problem you probably need to download the 2005 version of J# which you can locate here: &lt;a href="http://www.microsoft.com/express/2005/download/default.aspx"&gt;http://www.microsoft.com/express/2005/download/default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Tomorrow it's on to Chapter 7 - Methods. If you want to get ahead a little, read pp 157 to 161.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-816076419116841739?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/816076419116841739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=816076419116841739' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/816076419116841739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/816076419116841739'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/10/visual-j.html' title='Visual J#'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-907078192664782295</id><published>2008-10-14T15:49:00.000-04:00</published><updated>2008-10-14T20:29:53.104-04:00</updated><title type='text'>Getting Started</title><content type='html'>As I walked 'round the class today while you were working on the AccountSetup program, I noticed more than a couple of you have trouble just getting started. Once you get over that initial hump, you seem to be able to make progress. But the first step's a doozy.&lt;br /&gt;&lt;br /&gt;So, how to get started? How, for that matter, do I get started?&lt;br /&gt;&lt;br /&gt;It's a hard process to describe and I suspect that I don't always proceed in the same way.&lt;br /&gt;&lt;br /&gt;The first thing I do when getting started is to pick something simple that the program asks me to do. In AccountSetup (p. 139) one of the things we're asked to do is to get a user name and later on to display it. So I'd do that first. I'd declare a variable to hold the user name and then prompt the user to enter a user name and since I'll have to display it later, I might as well as display it now.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;String userName;&lt;br /&gt;&lt;br /&gt;System.out.print("Enter a user name, please: ");&lt;br /&gt;userName = System.Console.ReadLine();&lt;br /&gt;&lt;br /&gt;System.out.println("Your user name is " + userName);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;OK. That's a start. And it also relieves you of some of the mental effort of keeping track of that particular part  of the puzzle.&lt;br /&gt;&lt;br /&gt;The other thing we had to do in AccountSetup was to prompt the user for a password and keep prompting them until they entered a password with at least 8 characters. Of course, this means that we need a loop (because we're going to keep prompting them until we get a password that 8 characters or more long). It also means that you'll need another String variable to store the password in. This part of the program can be implemented with either a while or a do...while loop. And you might as well make the condition that keeps the loop running the thing that checks to see if the password is 8 characters long or not.&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;do&lt;br /&gt;{&lt;br /&gt;   System.out.print("Enter a password (8 characters minimum): ");&lt;br /&gt;   password = System.Console.ReadLine();&lt;br /&gt;} while (password.length &lt; 8);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I'll leave the last part up to you. That's the output part. Don't forget to convert the user name and password to lower case!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-907078192664782295?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/907078192664782295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=907078192664782295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/907078192664782295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/907078192664782295'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/10/getting-started.html' title='Getting Started'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-3624886675305255735</id><published>2008-10-09T12:18:00.000-04:00</published><updated>2008-10-09T21:36:14.214-04:00</updated><title type='text'>Factor this, buddy!</title><content type='html'>&lt;div&gt;Almost everbody has either done the Factorial program or is almost there. The really tricky part is seeing how using the for loop (or any loop, for that matter) allows you to incrementally solve the problem of calculating the factorial. Here's my take on it.&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;The factorial of a number is what we get when we multiply all the numbers between 1 and the number together. (We write it as 5! or 4! or whatever.)&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;5!  is  5 * 4 * 3 * 2 * 1  (= 120)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;4!  is  4 * 3 * 2 * 1 (=24)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;3!  is  3 * 2 * 1 (=6)&lt;br /&gt;&lt;br /&gt;The difficulty (conceptually speaking) is how to implement this relatively simple piece of mathematics in a loop.&lt;br /&gt;&lt;br /&gt;Let's look at 4!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;4! &lt;/span&gt;is &lt;span style="font-family:courier new;"&gt;4 * 3 * 2 * 1&lt;/span&gt; and is equal to &lt;span style="font-family:courier new;"&gt;24&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Look at the diagram below. Note that going from right to left, the number we are multiplying by increases by 1. That's our loop control variable (which I was calling &lt;span style="font-family:courier new;"&gt;idx&lt;/span&gt; today) because it is always incrementing by a set amount.&lt;br /&gt;&lt;br /&gt;In each loop we multiply the product of the previous loop by the current value of the counter. So in loop 3 below we multiply 2 (which was the product from the previous loop) by 3 which is the counter value in loop 3. In loop 4, we multiply that value (6) by the counter value (which is now 4) to get 24. We exit our &lt;span style="font-family:courier new;"&gt;for&lt;/span&gt; loop when the counter reaches the value that we got from the user.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Loop     4 * 3 * 2 * 1&lt;br /&gt; 2      |   |   |___|&lt;br /&gt;        |   |     |&lt;br /&gt; 3      |   3  *  2&lt;br /&gt;        |   |_____|&lt;br /&gt;        |      |&lt;br /&gt; 4      4   *  6&lt;br /&gt;        |______|&lt;br /&gt;           |&lt;br /&gt;           24&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Tomorrow, we'll be looking more closely at Strings and some neat methods we&lt;br /&gt;can use to manipulate them. Read pp 138 and 139 if you get the chance.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-3624886675305255735?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/3624886675305255735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=3624886675305255735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3624886675305255735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3624886675305255735'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/10/factor-this-buddy.html' title='Factor this, buddy!'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-9062136199857643110</id><published>2008-10-07T12:02:00.000-04:00</published><updated>2008-10-07T12:25:37.816-04:00</updated><title type='text'>Loop Tips</title><content type='html'>Here are a couple of pieces of advice regarding how to handle loops that arose from working with some of you today. Neither of these is always true. Consider them rules of thumb to be followed unless there's a reason not to.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Always increment your counters at the bottom of the loop after your loop processing has been completed. This helps you to control any effects that your counters might have on your calculations.&lt;/li&gt;&lt;li&gt;Report the results of loop calculations ouside the loop after it exits.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Please don't forget the homework for tomorrow. It's page 149, Qs 2, 4a, 7, 9, 10. It would also be helpful to re-read pp 135-137.&lt;/p&gt;&lt;p&gt;Finally, we'll also finish reviewing the test so bring your papers if you want to be able to track the corrections.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-9062136199857643110?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/9062136199857643110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=9062136199857643110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/9062136199857643110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/9062136199857643110'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/10/loop-tips.html' title='Loop Tips'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-5564307269999027319</id><published>2008-10-01T14:38:00.000-04:00</published><updated>2008-10-01T14:50:58.501-04:00</updated><title type='text'>Gettin' Loopy</title><content type='html'>Today we had our first encounter with loops in the form of the &lt;span style="font-family: courier new;"&gt;while&lt;/span&gt; and the &lt;span style="font-family: courier new;"&gt;do...while&lt;/span&gt; loop. (pp 131-134 in the text) Here are a couple of things to remember about loops:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the body of the loop (which can be one statement or many) keeps executing repeatedly (i.e. looping) while the loop condition remains true.&lt;/li&gt;&lt;li&gt;the loop condition is the same type of  Boolean expression as you find in the &lt;span style="font-family: courier new;"&gt;if&lt;/span&gt; and &lt;span style="font-family: courier new;"&gt;if...else&lt;/span&gt; statements&lt;/li&gt;&lt;li&gt;the loop condition is evaluated (to see if it's still true or not) every time the loop &lt;a href="http://en.wikipedia.org/wiki/Iterate"&gt;iterates&lt;/a&gt;&lt;/li&gt;&lt;li&gt;when the loop condition turns to false the loop stops executing and the program continues with the next statements after the loop&lt;/li&gt;&lt;li&gt;an improperly formed loop can iterate infinitely. (Bad, bad, programmer.)&lt;/li&gt;&lt;/ul&gt;Tomorrow we're going to talk about the &lt;span style="font-family: courier new;"&gt;for&lt;/span&gt; loop which is useful for iterating when the maximum or minimum number of iterations is known ahead of time. We'll also be talking about some debugging techniques that you can use to fix problems in longer programs.&lt;br /&gt;&lt;br /&gt;Homework for today? Why, yes, glad you asked. P149, Qs3, 5,  and 6.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-5564307269999027319?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/5564307269999027319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=5564307269999027319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/5564307269999027319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/5564307269999027319'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/10/gettin-loopy.html' title='Gettin&apos; Loopy'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-8297149771780963226</id><published>2008-09-26T06:27:00.000-04:00</published><updated>2008-09-26T13:22:22.146-04:00</updated><title type='text'></title><content type='html'>We spent some time on the board and the projector screen making sure that your understanding of conditionals is solid. You'll be using them all the time from now on so I want to make sure everybody's got it. Please make sure that you see me or email me if there's anything that you're unsure of about them.&lt;br /&gt;&lt;br /&gt;Then we talked about compound Boolean expressions which sound more fearsome than they are. Compound Booleans or, if you'd prefer, compound conditionals, are just a simpler way to write what would otherwise be a series of nested &lt;span style="font-family: courier new;"&gt;if...else&lt;/span&gt; statements. Suppose we're trying to find people who are between the ages of 18 and 65 then we could write:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if(age &gt;= 18)&lt;br /&gt;   if age( &lt;= 65)&lt;br /&gt;      System.out.println("You're in the right age group."); &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;But wouldn't it be simpler to write:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if((age &gt;= 18) || (age &lt;= 65))&lt;br /&gt;  System.out.println("You're in the right age group.");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In terms of hands on work we/you wrote the &lt;span style="font-style: italic;"&gt;Discriminant &lt;/span&gt;application on p108 and &lt;span style="font-style: italic;"&gt;Hurricane &lt;/span&gt;on p109. &lt;span style="font-style: italic;"&gt;Discriminant &lt;/span&gt;supports the use of nested &lt;span style="font-family:courier new;"&gt;if...else&lt;/span&gt; and the idea that we can test for negative numbers by testing for less than zero. &lt;span style="font-style: italic;"&gt;Hurricane &lt;/span&gt;gives practice using the &lt;span style="font-family:courier new;"&gt;switch&lt;/span&gt; statement.&lt;br /&gt;&lt;br /&gt;If you haven't already, once those two are done, go on to do &lt;span style="font-style: italic;"&gt;Delivery &lt;/span&gt;on p112. &lt;span style="font-style: italic;"&gt;Delivery &lt;/span&gt;involves the use of compound Boolean expressions.&lt;br /&gt;&lt;br /&gt;I forgot to ask you to do homework (bad teacher!) so if you're feeling all keen and want to get ahead, then do p121, Qs 1, 2, 3, 4b, 5 and 6 to really lock in your understanding of conditionals. Otherwise expect to do these questions on Monday night.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-8297149771780963226?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/8297149771780963226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=8297149771780963226' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/8297149771780963226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/8297149771780963226'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/09/we-spent-some-time-on-board-and.html' title=''/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-3717164211789576233</id><published>2008-09-23T12:54:00.000-04:00</published><updated>2008-09-23T13:03:31.938-04:00</updated><title type='text'></title><content type='html'>Nothing special today. We wrapped up the presentation on variables, Java arithmetic and constants and spent the balance of the class working on your GradeAverage and TempConverter applications. Most people seem to have found their way through it.&lt;br /&gt;&lt;br /&gt;Let me stress how important it is to keep up to speed on the application side of things. Most of what we are and are going to be learning is cumulative. 'C' builds on 'B' which was built on 'A', etc. If you get too far behind you will have trouble absorbing the new material as it will assume you (mostly) grasp what has been done so far.&lt;br /&gt;&lt;br /&gt;Tomorrow, I'll finish off checking your TempConverter and GradeAverage applications. If you haven't finished them you need to start coming to the lab early before class starts (I'm there every day by 8:40 at the latest and, so far, actually by 08:10) and/or requesting that I stay in the lab at lunch for you to catch up. That will be mostly up to you to initiate the extra help process.&lt;br /&gt;&lt;br /&gt;What's on the agenda for tomorrows class? Conditionals. These are the programming constructs that allow your program to start making decisions. In other words, some of the interesting stuff.&lt;br /&gt;&lt;br /&gt;A last note, I would really, really appreciate any feedback from you guys as to what is working for you (Yay!) or, more importantly, what is not working. You can use the comment section on the blog or just talk to me. Or leave an anonymous note.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-3717164211789576233?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/3717164211789576233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=3717164211789576233' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3717164211789576233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3717164211789576233'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/09/nothing-special-today.html' title=''/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-3857361130951127645</id><published>2008-09-22T09:03:00.000-04:00</published><updated>2008-09-22T12:28:25.594-04:00</updated><title type='text'>Testing, testing, 1, 2, 3</title><content type='html'>Homework for today is to read &lt;span style="font-weight: bold;"&gt;pages 105-110 in your text&lt;/span&gt;. We're starting what are called &lt;span style="font-style: italic;"&gt;conditional control structures&lt;/span&gt;.  This is the feature of the language that allows your program to make choices based on certain data. It's what allows your program to be responsive to input from outside itself.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;OK. I tried to introduce number formatting using the &lt;span style="color: rgb(255, 102, 102);font-family:courier new;" &gt;&lt;span style="font-weight: bold;"&gt;NumberFormat&lt;/span&gt; &lt;/span&gt;class and confused the whatchamacallit out of you - for which I apologize. We'll go over it again at the top of tomorrow's class but here's some background.&lt;br /&gt;&lt;br /&gt;I said that in order to use &lt;span style="font-weight: bold; color: rgb(255, 102, 102);font-family:courier new;" &gt;NumberFormat &lt;/span&gt;we needed to declare a &lt;span style="color: rgb(255, 102, 102); font-weight: bold;font-family:courier new;" &gt;NumberFormat &lt;/span&gt;object and I gave an example of such a declaration:&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 102);"&gt;NumberFormat myFormattingObj = NumberFormat.getInstance();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The line of code above creates a new &lt;span style="font-weight: bold; color: rgb(255, 102, 102);font-family:courier new;" &gt;NumberFormat &lt;/span&gt;object called &lt;span style="font-weight: bold; color: rgb(255, 102, 102);font-family:courier new;" &gt;myFormattingObj&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I hesitated when saying that because I realized that it contradicted what I had previously told you (and what you'd just practiced in the test) about declaring new objects in Java. Marya picked up on in it right away. Shouldn't it be something like &lt;span style="font-weight: bold; color: rgb(255, 102, 102);font-family:courier new;" &gt;NumberFormat myFormattingObj = new NumberFormat();&lt;/span&gt;, she asked?&lt;br /&gt;&lt;br /&gt;So, it turns out that there is  special type of method in Java called &lt;span style="font-style: italic;"&gt;factory methods&lt;/span&gt; whose particular job is to instantiate objects.  (If you have 10 minutes at some point I can explain why it's a good thing to have such a special type.) The &lt;span style="color: rgb(255, 102, 102); font-weight: bold;font-family:courier new;" &gt;getInstance() &lt;/span&gt;method of the &lt;span style="font-weight: bold; color: rgb(255, 102, 102);font-family:courier new;" &gt;NumberFormat &lt;/span&gt;class is such a factory method. All it does is return a new  object. Effectively, you could replace &lt;span style="font-weight: bold; color: rgb(255, 102, 102);font-family:courier new;" &gt;NumberFormatNumberFormat.getInstance();&lt;/span&gt; in the declaration above with &lt;span style="font-weight: bold; color: rgb(255, 102, 102);font-family:courier new;" &gt;new NumberFormat();&lt;/span&gt; For our purposes (and to the best of my understanding) it does exactly the same thing.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Aside from the mechanics of declaring an object using a factory method, it's probably confusing that you're declaring an object to do number formatting at all.&lt;br /&gt;&lt;br /&gt;Think of &lt;span style="font-weight: bold; color: rgb(255, 102, 102); font-family: courier new;"&gt;myFormattingObject &lt;/span&gt;as like a small custom body shop or garage that you declare to do some work on your numbers.&lt;br /&gt;&lt;br /&gt;First you create the body shop: &lt;span style="color: rgb(255, 102, 102); font-weight: bold; font-family: courier new;"&gt;NumberFormat myFormattingObj = NumberFormat.getInstance():&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then you tell the body shop how you want to customize your number: &lt;span style="font-weight: bold; color: rgb(255, 102, 102); font-family: courier new;"&gt;myFormattingObj.setMaximumFractionDigits(3);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This says to set the maximum number of digits to display to be 3.&lt;br /&gt;&lt;br /&gt;Then you submit your number to the body shop to have the work done on it: &lt;span style="color: rgb(255, 102, 102); font-weight: bold; font-family: courier new;"&gt;myFormattingObj.format(numWithDecimal);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If your number was 5.678948,  then the result of the the last bit of code would be 5.679.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-3857361130951127645?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/3857361130951127645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=3857361130951127645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3857361130951127645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/3857361130951127645'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/09/testing-testing-1-2-3.html' title='Testing, testing, 1, 2, 3'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-2454314763952532939</id><published>2008-09-19T19:33:00.001-04:00</published><updated>2008-09-19T19:55:49.761-04:00</updated><title type='text'>Review for Monday's Test</title><content type='html'>Most of today was test review. [You know there's a test on Monday, right?] Please check the handout folder for a copy of the review handout (&lt;span style="font-family:courier new;"&gt;ICS3M_RvwNotes_1.d&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;oc&lt;/span&gt;) that we looked over in class.&lt;br /&gt;&lt;br /&gt;I also asked a number of students (at random) to put questions from last night's homework on the board. &lt;span style="font-weight: bold;"&gt;No. one. &lt;/span&gt;(that I asked) &lt;span style="font-weight: bold;"&gt;had. done. it. &lt;/span&gt;Here's the threat. If no one sees fit to do the homework then I'm going to get all Grade 9-ey and start going round the class and checking homework and calling home and stuff. Let's not go there. Last warning.&lt;br /&gt;&lt;br /&gt;On a lighter note, I mentioned a flash game that targeted the programming skill set. It's behind the school firewall but the &lt;a href="http://www.gameroo.nl/games/light-bot"&gt;link is here&lt;/a&gt;. It's neat and making it work does actually have something to do with programming skills. Check it out.&lt;br /&gt;&lt;br /&gt;Last thing. I stumbled across &lt;a href="http://chronicle.com/cgi2-bin/printable.cgi?article=http://chronicle.com/free/v55/i04/04b01001.htm"&gt;this article&lt;/a&gt; on online literacy - or the lack thereof. The basic argument is that in spite of all the hopes that the "online experience" would produce a renaissance of literacy, the experience of consuming text online is somehow impaired. It certainly reflect my own experience consuming text online (and I spend a lot of time on the net). I'm all about loving computers and the massive uber-connectiveness that is the &lt;a href="http://en.wikipedia.org/wiki/Internet"&gt;SeriesOfTubes&lt;/a&gt; but I'm also a long-time book reader from before the dawn of time (ca. 1966) with a big hardcopy library. There are some important ideas in the article.&lt;br /&gt;&lt;br /&gt;Good luck on Monday. Have a good weekend!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-2454314763952532939?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/2454314763952532939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=2454314763952532939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/2454314763952532939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/2454314763952532939'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/09/review-for-mondays-test.html' title='Review for Monday&apos;s Test'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-2520210414267732199</id><published>2008-09-17T22:30:00.001-04:00</published><updated>2008-09-18T19:02:16.455-04:00</updated><title type='text'>Movin' On</title><content type='html'>Everybody pretty much finished up the &lt;span style="font-family: courier new;"&gt;ParseInteger &lt;/span&gt;program today. I'll post my solution soon.&lt;br /&gt;&lt;br /&gt;We moved on to discuss &lt;span style="font-style: italic;"&gt;typecasting&lt;/span&gt; and the situations in which it might be used and this led us to the notion that when typecasting a &lt;span style="font-family:courier new;"&gt;double&lt;/span&gt; to an &lt;span style="font-family:courier new;"&gt;int&lt;/span&gt; we should consider rounding the &lt;span style="font-family:courier new;"&gt;int&lt;/span&gt; values when doing it so as to preserve as much accuracy as possible.&lt;br /&gt;&lt;br /&gt;We also discussed the order of arithmetic operations. Misunderstanding this order can lead to unexpected results in your programs. Be careful, it's a minefield out there, people.&lt;br /&gt;&lt;br /&gt;There are two new applications to work on: &lt;span style="font-family:courier new;"&gt;GradeAvg&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;TempConverter&lt;/span&gt; from page 85 of the text.&lt;br /&gt;&lt;br /&gt;There is also homework: page 97 Qs 6-10. I'd mentioned the possibility of doing Qs 13, 14, and 15 but we didn't get that far in the presentation today so we'll save them for later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-2520210414267732199?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/2520210414267732199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=2520210414267732199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/2520210414267732199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/2520210414267732199'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/09/everybody-pretty-much-finished-up.html' title='Movin&apos; On'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-1220668277588415435</id><published>2008-09-17T22:30:00.000-04:00</published><updated>2008-09-17T22:41:26.452-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='problem solving'/><title type='text'>Parsing the Integer; Hunting the Snipe</title><content type='html'>Today was all about consolidating yesterday's admittedly confusing  foray into integer and modulus division. (Sorry!) It seems like most of you get it, now, and should be able to finish your ParseInteger programs tomorrow.&lt;br /&gt;&lt;br /&gt;Many thanks to all those students who were able to finish early and then move on to help others.&lt;br /&gt;&lt;br /&gt;If there's one thing I want you to take away from today, it's some hints about the thinking process that you can (and should!) go through when confronted with a difficult programming problem.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Write down what you're supposed to do. Write it down, even if it's already given to you written down. The actual act of writing it down shifts your brain into the problem space.&lt;/li&gt;&lt;li&gt;Write down what you know about the problem. Don't worry too much about how organized it is. If you have pieces of the puzzle put them down even if you don't know how they fit together. This is just a version of the kind of brainstorming you might do before writing and essay or short story in English or the kind of noodling a musician might do when approaching a composition.&lt;/li&gt;&lt;li&gt;Get a high-level design down on paper - just the big, gross steps of what you think needs to happen in the program. E.g. Get some input; Process some input; Print some Output.&lt;/li&gt;&lt;li&gt;I didn't talk about this but the fourth thing is to experiment. Hack at it. Try some stuff and see if it works.&lt;/li&gt;&lt;/ol&gt;Don't forget to check my notes that I did on the projector today and put in the Handout Folder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-1220668277588415435?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/1220668277588415435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=1220668277588415435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/1220668277588415435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/1220668277588415435'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/09/parsing-integer-hunting-snipe.html' title='Parsing the Integer; Hunting the Snipe'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-4100519908776069943</id><published>2008-09-16T12:02:00.000-04:00</published><updated>2008-09-16T12:14:13.286-04:00</updated><title type='text'>Divided We Fall</title><content type='html'>See slides 8 through 11 of &lt;span style="font-weight: bold;font-family:courier new;" &gt;ICS3M_1.9_VarsConsts_2.ppt&lt;/span&gt; for what we covered today. (Basically integer division and modulus division.)  Everyone started work on the project/assignment (call it what you will) that's on slide # 11.&lt;br /&gt;&lt;br /&gt;Here's a hint:&lt;br /&gt;&lt;br /&gt;Assuming the user has input 647 then:&lt;br /&gt;647 / 100 ==&gt; 6&lt;br /&gt;47 / 10 ==&gt; 4&lt;br /&gt;7 / 1 ==&gt; 7&lt;br /&gt;&lt;br /&gt;The challenge is that although you get 647 from the user you have to figure out how to get the 47 and then the 1 in order to perform the integer division on them. Could modulus division be the answer?&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:130%;" &gt;HEAR YE! HEAR YE! HEAR YE!&lt;/span&gt;&lt;br /&gt;Mini-test next Monday the 22 of September on what we will have covered by then. There'll be a review on Friday's class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-4100519908776069943?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/4100519908776069943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=4100519908776069943' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/4100519908776069943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/4100519908776069943'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/09/divided-we-fall.html' title='Divided We Fall'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9006965196529766208.post-6830857064274551447</id><published>2008-09-16T12:00:00.000-04:00</published><updated>2008-09-16T12:02:06.272-04:00</updated><title type='text'>Welcome to the ICS3M blog</title><content type='html'>Hi everyone,&lt;br /&gt;&lt;br /&gt;Here's the plan. I'll use this space to put up announcements, homework and a brief summary of what we did on a particular day if it's applicable. Check in here if you were away and want to find out what to do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9006965196529766208-6830857064274551447?l=ics3mcanterbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ics3mcanterbury.blogspot.com/feeds/6830857064274551447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9006965196529766208&amp;postID=6830857064274551447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/6830857064274551447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9006965196529766208/posts/default/6830857064274551447'/><link rel='alternate' type='text/html' href='http://ics3mcanterbury.blogspot.com/2008/09/welcome-to-ics3m-blog.html' title='Welcome to the ICS3M blog'/><author><name>Mr. Mac</name><uri>http://www.blogger.com/profile/15585262958846412558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://1.bp.blogspot.com/-y8EwSEWdWFQ/TzlmrZ3odYI/AAAAAAAAAHw/Vcx0iiHX3xg/s220/3189455295_9762d2a3d8.jpg'/></author><thr:total>0</thr:total></entry></feed>
