<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sukolsaksakshuwong's Weblog</title>
	<atom:link href="http://sukolsaksakshuwong.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sukolsaksakshuwong.wordpress.com</link>
	<description>Blog of Sukolsak Sakshuwong (Gee) for Mr.Forsberg's Class</description>
	<lastBuildDate>Tue, 15 Apr 2008 12:27:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sukolsaksakshuwong.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sukolsaksakshuwong's Weblog</title>
		<link>http://sukolsaksakshuwong.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sukolsaksakshuwong.wordpress.com/osd.xml" title="Sukolsaksakshuwong&#039;s Weblog" />
	<atom:link rel='hub' href='http://sukolsaksakshuwong.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Chapter 12</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2008/04/10/chapter-12/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2008/04/10/chapter-12/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 15:56:16 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/?p=20</guid>
		<description><![CDATA[12.1 1. It always has the stopping statement. 2. Recursive statements and stopping statements. 3. It creates stacks in the system. 4. There are many situations in which recursion provides the clearest, shortest, and most elegant solution to a programming task. 5. raise(2,5) &#8230;calls raise(2,4) &#8230;&#8230;call raise(2,3) &#8230;&#8230;&#8230;call raise(2,2) &#8230;&#8230;&#8230;&#8230;call raise(2,1) &#8230;&#8230;&#8230;&#8230;&#8230;call raise(2,0) &#8230;&#8230;&#8230;&#8230;&#8230;which returns [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=20&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>12.1</strong></p>
<p>1. It always has the stopping statement.</p>
<p>2. Recursive statements and stopping statements.</p>
<p>3. It creates stacks in the system.</p>
<p>4. There are many situations in which recursion provides the clearest, shortest, and most elegant solution to a programming task.</p>
<p>5.<br />
raise(2,5)<br />
&#8230;calls raise(2,4)<br />
&#8230;&#8230;call raise(2,3)<br />
&#8230;&#8230;&#8230;call raise(2,2)<br />
&#8230;&#8230;&#8230;&#8230;call raise(2,1)<br />
&#8230;&#8230;&#8230;&#8230;&#8230;call raise(2,0)<br />
&#8230;&#8230;&#8230;&#8230;&#8230;which returns 1<br />
&#8230;&#8230;&#8230;&#8230;which returns 2*1 which is 2<br />
&#8230;&#8230;&#8230;which returns 2*2 which is 4<br />
&#8230;&#8230;which returns 2*4 which is 8<br />
&#8230;which returns 2*8 which is 16<br />
which returns 2*16 which is 32</p>
<p>6. infinite recursion</p>
<p><strong>12.2</strong></p>
<p>1.<br />
a) O(n)<br />
b) O(n)</p>
<p>2.<br />
a) O(n)<br />
b) O(2<sup>n</sup>)</p>
<p>3. O(n<sup>2</sup>)</p>
<p><strong>12.3</strong></p>
<p>1.<br />
<code>int raise(int base, int expo){</code><br />
<code>if(expo==0)return 1;</code><br />
<code>int tmp = raise(base, expo / 2);</code><br />
<code>if(expo % 2 == 0){</code><br />
<code>return tmp*tmp;</code><br />
<code>}else{</code><br />
<code>return tmp*tmp*base;</code><br />
<code>}</code><br />
<code>}</code></p>
<p>2.<br />
raise(2,10)<br />
&#8230;&#8230;.calls raise(2,5)<br />
&#8230;&#8230;&#8230;&#8230;..call raise(2,2)<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;call raise(2,1)<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.call raise(2,0)<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..which 1<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;which returns 1*1*2 which is 2<br />
&#8230;&#8230;&#8230;&#8230;..which returns 2*2 which is 4<br />
&#8230;&#8230;.which returns 4*4*2 which is 32<br />
which returns 32*32 which is 1024</p>
<p>3. O(log n)</p>
<p><strong>12.4</strong></p>
<p>1. Break an array into two parts and then move elements around so that all the larger values are in one end and all the smaller values are in the other. Each of the two parts is then subdivided in the same manner, and so on, until the subparts contain only a single value, at which point the array is sorted. Because of dividing, The time complexity is reduced from O(n) to O(n log n).</p>
<p>2. In case that the largest values are selected to be the pivots, the time complexity will be O(n<sup>2</sup>).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=20&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2008/04/10/chapter-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>Chapter 9</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2008/02/20/chapter-9/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2008/02/20/chapter-9/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 13:40:48 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/?p=19</guid>
		<description><![CDATA[9.1 1. It can create a set of variables in one command 2. Access by index. For example, x = arr[5]; 3. wage[1][1] = 100.0; //wage of 1st person for Monday wage[1][2] = 50.0; //wage of 1st person for Tuesday wage[2][1] = 70.0; //wage of 2nd person for Monday wage[2][2] = 45.5; //wage of 2nd [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=19&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b>9.1</b></p>
<p>1. It can create a set of variables in one command</p>
<p>2. Access by index. For example, x = arr[5];</p>
<p>3. wage[1][1] = 100.0; //wage of 1st person for Monday<br />
wage[1][2] = 50.0; //wage of 1st person for Tuesday<br />
wage[2][1] = 70.0; //wage of 2nd person for Monday<br />
wage[2][2] = 45.5; //wage of 2nd person for Tuesday</p>
<p><b>9.2</b></p>
<p>1.<br />
a) 23<br />
b) 12<br />
c) 156</p>
<p>2. It will show an error message like index is out of bound</p>
<p><b>9.3</b></p>
<p>1.<br />
for(int i=; i &lt; abc.length; i++){<br />
System.out.println(abc[i]);<br />
}</p>
<p>2.<br />
for(int i=abc.length-1; i &gt;= 0; i&#8211;){<br />
System.out.println(abc[i]);<br />
}</p>
<p>3.<br />
for(int i=; i &lt; a.length; i++){<br />
if(a[i]&lt;0){<br />
break;<br />
}<br />
}</p>
<p>4. find the absolute value of each element of array a</p>
<p>5. create a string from each element of array a</p>
<p><b>9.4</b></p>
<p>1. a) double[] a = new double[15];<br />
b) String[] a = new String[20];</p>
<p>2. List that declares each element of array in the initializing step.</p>
<p>3. a) int[] score = {100, 90, 75, 60, 88};<br />
b) double[] interest = {0.12, 0.05, 0.15};<br />
c) String[] myname = {Sukolsak, Sakshuwong};</p>
<p>4. The first one clearly declares that it is an array at the first, while the second one the programmer has to look at the following part.</p>
<p><b>9.5</b></p>
<p>1. The program can still run but there may be a logical error occurring.</p>
<p>2. A program that inputs number from a file into an array.</p>
<p><b>9.6</b></p>
<p>1. Arrays of the same length but with different component data types.</p>
<p>2. The program that keeps a list of people&#8217;s names and ages.</p>
<p>3.<br />
String[] name = new String[50];<br />
int[] age = new age[50];<br />
String[] ssn = new String[50];</p>
<p>4.<br />
for(int i = 0;i &lt; names.length; i++){<br />
System.out.printf(&#8220;%-20s%s&#8221;,names[i],numbers[i]);<br />
}</p>
<p>5.<br />
int[] a = {0,1,2,3,4,5,6,7,8,9};<br />
int[] b = {1,2,4,8,16,32,64,128,256,512};</p>
<p><b>9.7</b></p>
<p>1. An array in which each data item is accessed by specifying a pair of indices.</p>
<p>2. A program that store a table of numbers.</p>
<p>3.<br />
int found=0;<br />
for(int i=0;i&lt;row;i++){<br />
for(int j=0;j&lt;col;j++){<br />
if(a[i][j]&lt;0){<br />
found=1;<br />
break;<br />
}<br />
}<br />
if(found==1)break;<br />
}</p>
<p>4.</p>
<table border="1">
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>0</td>
<td>2</td>
<td>4</td>
<td>6</td>
<td>8</td>
</tr>
<tr>
<td>0</td>
<td>3</td>
<td>6</td>
<td>9</td>
<td>12</td>
</tr>
<tr>
<td>0</td>
<td>4</td>
<td>8</td>
<td>12</td>
<td>16</td>
</tr>
</table>
<p>9.8</p>
<p>1.<br />
a)<br />
for(String element : abc)<br />
System.out.print(element);<br />
b)<br />
for(String element : abc)<br />
if(target.equals(element)){<br />
found=true;<br />
break;<br />
}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=19&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2008/02/20/chapter-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>Chapter 8</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2008/01/17/11708/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2008/01/17/11708/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 13:30:36 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/2008/01/17/11708/</guid>
		<description><![CDATA[8.1 1. hypertext comes from an idea of Vannevar Bush, a scientist at MIT. He proposed to use computer technology to link chunks of information associatively. 2. hypermedia is like hypertext, but adds GUIs, images, sound, animation, and applications. 3. Uniform Resource Locator (URL) is the global address of documents and other resources on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=18&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b>8.1</b></p>
<p>1. hypertext comes from an idea of Vannevar Bush, a scientist at MIT. He proposed to use computer technology to link chunks of information associatively.</p>
<p>2. hypermedia is like hypertext, but adds GUIs, images, sound, animation, and applications.</p>
<p>3. Uniform Resource Locator (URL)  is the global address of documents and other resources on the World Wide Web.</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>8.2</b></p>
<p>1. Hypertext Markup Language</p>
<p>2. To indicate the format of textual elements or links to other nodes</p>
<p>3.<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Test&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
Hello  World!<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>4.<br />
The comment that is not interpreted by the browser and is not shown to the reader. For example, &lt;!&#8211;This is an comment &#8211;&gt;</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>8.3</b></p>
<p>1. When the author wants to display several lines of text without word wrap.</p>
<p>2. When we want the browser to display text with line breaks, extra spaces, and tabs.</p>
<p>3.<br />
&lt;h1&gt;level 1 heading&lt;/h1&gt;<br />
&lt;h2&gt;level 2 heading&lt;/h2&gt;</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>8.4</b></p>
<p>1. Text that comes after &lt;i&gt; will be italic text.</p>
<p>2. To display special characters (&lt;, &gt;, and &amp;) rather than interpret them.<br />
For example, the character &lt; begins an HTML markup tag.</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>8.5</b></p>
<p>1.</p>
<ul>
<li>Unordered (bulleted) lists</li>
<li>Numbered (ordered) lists</li>
<li>Definition (association) list</li>
</ul>
<p>2.</p>
<p>&lt;UL&gt;<br />
&lt;LI&gt;My father: Somsak Sakshuwong<br />
&lt;UL&gt;<br />
&lt;LI&gt;Father of my father: Eng-jun Sakshuwong<br />
&lt;LI&gt;Mother of my father: Kim-nai Sakshuwong<br />
&lt;/UL&gt;<br />
&lt;LI&gt;My mother: Sumongkol Sakshuwong<br />
&lt;UL&gt;<br />
&lt;LI&gt;Father of my mother: Soodjai Kannaleka<br />
&lt;LI&gt;Mother of my mother: Yoopin Kannaleka<br />
&lt;/UL&gt;<br />
&lt;/UL&gt;</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>8.6 </b></p>
<p>1. &lt;A href=&#8221;<i>target document</i>&#8220;&gt;<i>text of link</i>&lt;/A&gt;</p>
<p>2.  A string that specifies the location of a resource, such as an HTML file, on a Web server. For example, <code>http://www.test.com/test.jpg</code></p>
<p>3. A string that specifies the location of a document&#8217;s position relative to that of the currently displayed document. For example, <code>../../test.html</code></p>
<p>4. http://<i>server name</i>/<i>document path name</i></p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>8.7 </b></p>
<p>1. Internal images are displayed when the user opens a page. External images are not displayed until the user clicks on a link.</p>
<p>2. &lt;IMG src=&#8221;<i>ImageLocation</i>&#8220;&gt;</p>
<p>3. &lt;IMG src=&#8221;image.gif&#8221; HEIGHT=200 WIDTH=200 ALIGN=CENTER&gt;</p>
<p>4. The first link is a string of text. For example, &lt;A href=&#8221;test.gif&#8221;&gt;Sample picture&lt;/A&gt;. The second link is a smaller version of the image. For example, &lt;A href=&#8221;test.gif&#8221;&gt;&lt;IMG src=&#8221;mythumbnail.gif&#8221;&gt;&lt;/A&gt;</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>8.8</b></p>
<p>1.<br />
Use &lt;TABLE&gt; to define a table, &lt;TR&gt; to define a row within a table, and &lt;TD&gt; to define a data cell.</p>
<p>2.<br />
&lt;TABLE&gt;<br />
&lt;TR&gt;<br />
&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;<br />
&lt;/TR&gt;<br />
&lt;TR&gt;<br />
&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;<br />
&lt;/TR&gt;<br />
&lt;TR&gt;<br />
&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;<br />
&lt;/TR&gt;<br />
&lt;/TABLE&gt;</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>8.9</b></p>
<p>1. &lt;APPLET CODE=&#8221;<i>byte code file name</i>&#8221; WIDTH=<i>width</i> HEIGHT=<i>height</i>&gt;&lt;APPLET&gt;. For example, &lt;APPLET  CODE=&#8221;GUIWindow.class&#8221; WIDTH=250 HEIGHT=100&gt;</p>
<p>2. Replace the name <code>JFrame</code> with the name <code>JApplet</code> at the beginning of the class definition (<code>extends JApplet</code>) and replace the class&#8217;s constructor by the method <code>init</code>.</p>
<p>3. Apples cannot access files on the machine.</p>
<p>4. The <code>JApplet</code> method <code>getDocumentBase()</code> locates and returns the URL of the applet&#8217;s Web server. The <code>JApplet</code> method <code>getImage</code> expects this URL and the filename of an images as parameters. The method downloads the image from the Web server and returns an object of the class <code>Image</code>. This object can be converted to an <code>ImageIcon</code> object for further processing by using the <code>ImageIcon(anImage)</code> constructor.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=18&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2008/01/17/11708/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>1/15/08</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2008/01/15/11508/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2008/01/15/11508/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 16:34:55 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/2008/01/15/11508/</guid>
		<description><![CDATA[7.4 1. a) %1d b) %2d c) %-3d d) system.out.printf(&#8220;%6d&#8221;, i); e) system.out.printf(&#8220;%10.2f&#8221;, d); 2. a) Price 10,000.50 b) 45 632 c) 34.54 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7.5 1. The statement will throw and exception. The code within the catch clause is then executed. 2. the statements within the try clause are executed. If there is a statement [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=17&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b>7.4</b></p>
<p>1.<br />
a) %1d<br />
b) %2d<br />
c) %-3d<br />
d) system.out.printf(&#8220;%6d&#8221;, i);<br />
e) system.out.printf(&#8220;%10.2f&#8221;, d);</p>
<p>2.<br />
a) Price<code>            </code>10,000.50<br />
b) 45 632<br />
c) 34.54</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>7.5</b></p>
<p>1. The statement will throw and exception. The code within the <code>catch</code> clause is then executed.</p>
<p>2. the statements within the try clause are executed. If there is a statement throwing an exception,  the code within the <code>catch</code> clause is then executed. If no statement throws an exception, the <code>catch</code> clause is skipped.</p>
<p>3.<br />
<code>try{</code><br />
<code>System.out.print("Enter a number: ");</code><br />
<code>x = reader.nextDouble();</code><br />
<code>break;</code><br />
<code>}catch(Exception e){</code><br />
<code>System.out.println("Error in number format");</code><br />
<code>reader.nextLine();</code><br />
<code>}</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=17&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2008/01/15/11508/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>1/7/08</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2008/01/07/1708/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2008/01/07/1708/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 14:16:56 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/2008/01/07/1708/</guid>
		<description><![CDATA[7.2 1. String doItAgain = &#8220;y&#8221; while (doItAgain equals &#8220;y&#8221; or &#8220;Y&#8221;){ read input show output read doItAgain } 2. the method toLowerCase converts string to lower case. So we can compare control string (Y, y, N, and n) in one time. &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 7.3 1. it shows all of the choices to the user 2. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=16&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b>7.2</b></p>
<p>1.<br />
String doItAgain = &#8220;y&#8221;<br />
while (doItAgain equals &#8220;y&#8221; or &#8220;Y&#8221;){<br />
read input<br />
show output<br />
read doItAgain<br />
}</p>
<p>2. the method toLowerCase converts string to lower case. So we can compare control string (Y, y, N, and n) in one time.</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p><b>7.3</b></p>
<p>1. it shows  all of the choices to the user</p>
<p>2.<br />
menuOption = 0<br />
while (menuOption != 3){<br />
print menu<br />
read menuOption<br />
if (menuOption == 1)<br />
&#8230;<br />
}<br />
else if (menuOption == 2) {<br />
&#8230;<br />
}<br />
else if (menuOption == 3)<br />
print &#8220;Goodbye!&#8221;<br />
else<br />
print &#8220;Invalid Option&#8221;<br />
}</p>
<p>3.<br />
import java.util.*;<br />
class Menu{<br />
public static void main(String[] args){<br />
Scanner reader = new Scanner(System.in);<br />
int size=5;<br />
int topping=1;<br />
String[] topp = new String[]{&#8220;&#8221;,&#8221;Mushrooms&#8221;,&#8221;Peppers&#8221;,&#8221;Sausage&#8221;};<br />
String tmp;<br />
int menuOption=0;<br />
while (menuOption!=4){<br />
System.out.println(&#8220;Size : &#8220;+size+&#8221;\nTopping : &#8220;+topp[topping]+&#8221;\n&#8221;);<br />
System.out.println(&#8220;1) Specify the size of a pizza\n&#8221;+<br />
&#8220;2) Specify the various toppings\n&#8221;+<br />
&#8220;3) Place the order\n&#8221;+<br />
&#8220;4) Quit&#8221;);<br />
menuOption = reader.nextInt();<br />
if(menuOption==1){<br />
System.out.print(&#8220;Enter the size of pizza: &#8220;);<br />
size = reader.nextInt();<br />
System.out.println(&#8220;Your pizza&#8217;s size has changed.&#8221;);<br />
}else if(menuOption==2){<br />
System.out.println(&#8220;Select the topping&#8221;);<br />
System.out.println(&#8220;1) Mushrooms\n&#8221;+<br />
&#8220;2) Peppers\n&#8221;+<br />
&#8220;3) Sausage&#8221;);<br />
topping = reader.nextInt();<br />
System.out.println(&#8220;Your pizza&#8217;s topping has changed.&#8221;);<br />
}else if(menuOption==3){<br />
System.out.println(&#8220;Your order is completed.\nThank you!&#8221;);<br />
}else if(menuOption==4){<br />
System.out.println(&#8220;Goodbye!&#8221;);<br />
}else{<br />
System.out.println(&#8220;Invalid Option&#8221;);<br />
}<br />
tmp = reader.nextLine();<br />
tmp = reader.nextLine();<br />
System.out.println(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;\n&#8221;);<br />
}<br />
}<br />
}��</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=16&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2008/01/07/1708/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>11/28/07</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2007/11/28/112807/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2007/11/28/112807/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 15:09:42 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/2007/11/28/112807/</guid>
		<description><![CDATA[6.1 1. P Q !((P&#124;&#124;Q)&#38;&#38;(P&#38;&#38;Q)) true true false true false true false true true false false true 2. a. true b. false c. true d. false 4. 1) ! 2) &#38;&#38; 3) &#124;&#124; 5. (min &#60;= x) &#38;&#38; (x &#60;= max) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 6.2 1. a) 200, 1, 0, 200 b) 200, 101, 100, 50, 1, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=15&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>6.1</strong></p>
<p>1.</p>
<table border="1">
<tr>
<td><code>P</code></td>
<td><code>Q</code></td>
<td><code>!((P||Q)&amp;&amp;(P&amp;&amp;Q))</code></td>
</tr>
<tr>
<td>true</td>
<td>true</td>
<td>false</td>
</tr>
<tr>
<td>true</td>
<td>false</td>
<td>true</td>
</tr>
<tr>
<td>false</td>
<td>true</td>
<td>true</td>
</tr>
<tr>
<td>false</td>
<td>false</td>
<td>true</td>
</tr>
</table>
<p>2.<br />
a. true<br />
b. false<br />
c. true<br />
d. false</p>
<p>4.<br />
1) !<br />
2) &amp;&amp;<br />
3) ||</p>
<p>5. (min &lt;= x) &amp;&amp; (x &lt;= max)</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p><strong>6.2</strong></p>
<p>1.<br />
a) 200, 1, 0, 200<br />
b) 200, 101, 100, 50, 1, 0, -200</p>
<p>2. every line in a program is executed at least once.</p>
<p>3. All the sets of test data that exercise a program in the same manner. Example in (6)</p>
<p>4. Cases that are near the boundaries between equivalence classes. Example in (6)</p>
<p>5. Data at the limits of validity. Example in (6)</p>
<p>6. equivalent classes : {0, 1, 2, 3, &#8230;, 59}, {60, 61, 62, &#8230;, 100}<br />
boundary conditions : 59, 60<br />
extreme conditions : -1, 101</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p><strong>6.3</strong></p>
<p>1.</p>
<table border="1">
<tr>
<td>the time is before noon</td>
<td>the day is monday</td>
<td>action taken</td>
</tr>
<tr>
<td>true</td>
<td>true</td>
<td>take the computer science quiz</td>
</tr>
<tr>
<td>true</td>
<td>false</td>
<td>go to gym class</td>
</tr>
<tr>
<td>false</td>
<td>true</td>
<td>throw a Frisbee in the quad</td>
</tr>
<tr>
<td>false</td>
<td>false</td>
<td>throw a Frisbee in the quad</td>
</tr>
</table>
<p>2. A nested if statement can deal with a situation that has two or more conditions easier than a multiway if statement.</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p align="left"><strong>6.4</strong></p>
<p align="left">1. if the income is greater 20000, then the rate will be 0.10 though the real rate is 0.18 or more.</p>
<p align="left">2.<br />
if (income &gt; 50000){<br />
rate = 0.40;<br />
}else if (income &gt;20000){<br />
rate = 0.18;<br />
}else if (income &gt; 10000){<br />
rate = 0.10;<br />
}else{<br />
rate = 0.0;<br />
}</p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p align="left"><strong>6.5</strong></p>
<p align="left"> 1.<br />
a) <code>1 2 3 1 2 3 1 2 3</code><br />
b) <code>1 2 3</code><br />
<code>1 2 3</code><br />
<code>1 2 3</code></p>
<p align="left">2.<br />
a) <code>for(int i=0; i&lt;5; i++){</code><br />
<code>for(int j=1; j&lt;=5; j++)</code><br />
<code>System.out.print((i*5+j) + " ");</code><br />
<code>System.out.println("");</code><br />
<code>}</code><br />
b) <code>for(int i=1; i&lt;=5; i++){</code><br />
<code>for(int j=1; j&lt;=5; j++)</code><br />
<code>System.out.print((i+j) + " ");</code><br />
<code>System.out.println("");</code><br />
<code>}</code></p>
<p align="center">&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p align="left"><strong>6.6</strong></p>
<p align="left">1.<br />
a) -2, -1, 0,   1, 10<br />
b) -10, -1, 0, 50, 100, 101, 120</p>
<p align="left">2. initial number of organism: 0<br />
rate of growth: 3<br />
the number of hours to achieve the rate: 2<br />
number of hours during which the population grows: 10</p>
<p align="left">initial number of organism: 1<br />
rate of growth: 3<br />
the number of hours to achieve the rate: 1<br />
number of hours during which the population grows: 0</p>
<p align="left">initial number of organism: 10<br />
rate of growth: 2<br />
the number of hours to achieve the rate: 1<br />
number of hours during which the population grows: 1</p>
<p align="left">initial number of organism: 2<br />
rate of growth: 2<br />
the number of hours to achieve the rate: 1<br />
number of hours during which the population grows:10</p>
<p align="left">3. Test no iterations, one iteration, and multiple iterations</p>
<p align="left">4. A program that tolerates errors in user inputs and recovers gracefully. for example<br />
while(true){<br />
System.out.print(&#8220;Enter 1 or 2: &#8220;);<br />
x = reader.nextInt();<br />
if(x==1 || x==2)break;<br />
}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=15&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2007/11/28/112807/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>11/1/07</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2007/11/02/11107/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2007/11/02/11107/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 13:26:16 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/2007/11/02/11107/</guid>
		<description><![CDATA[5.4 1. Formal parameters are parameters listed in a method&#8217;s definition. Actual parameters are values passed to a method when it is invoked. 2. The actual parameters must match the formal parameters in position and type. Java will copy values of actual parameters to formal parameters. 3. int sum(int x,int y){ return x+y; } 4. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=14&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>5.4</strong></p>
<p>1. Formal parameters are parameters listed in a method&#8217;s definition. Actual parameters are values passed to a method when it is invoked.</p>
<p>2. The actual parameters must match the formal parameters in position and type. Java will copy values of actual parameters to formal parameters.</p>
<p>3.<br />
int sum(int x,int y){<br />
return x+y;<br />
}</p>
<p>4. to have temporary working storage for data in a method.</p>
<p><strong>5.5</strong></p>
<p>1. instance variables last for the lifetime of an object. local variables and parameters are no longer accessible once the method stops executing.</p>
<p>2. a local name and a global variable name are the same name. for example:<br />
public class Test{<br />
private int x;<br />
public void someMethod{<br />
int x;<br />
&#8230;.<br />
}<br />
}</p>
<p>3.<br />
a) instance variables are a and b. parameters are x and y. local variables are c and d.<br />
b) a, b &#8211; whole class. x,y,c, d &#8211; in method aMutator.<br />
c) a, b last for the lifetime of an object. x,y,c,d are no longer accessible once the method stops executing.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=14&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2007/11/02/11107/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>10/18/07</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2007/10/18/101807/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2007/10/18/101807/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 18:29:46 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/2007/10/18/101807/</guid>
		<description><![CDATA[5.1 1. An object is a runtime entity that contains data and responds to messages. A class is a software package or template that describes the characteristics of similar objects. 2. JVM will delete it from memory during a process called garbage collection. 3. An object has behavior as defined by method of its class. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=13&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>5.1</strong></p>
<p>1. An object is a runtime entity that contains data and responds to messages. A class is a software package or template that describes the characteristics of similar objects.</p>
<p>2. JVM will delete it from memory during a process called garbage collection.</p>
<p>3.</p>
<ul>
<li>An object has <em>behavior</em> as defined by method of its class.</li>
<li>An object has <em>state</em>: at any particular moment its instance variable have particular values.</li>
<li>An object has is own unique <em>identity</em>, which distinguishes it from all other objects in the computer&#8217;s memory.</li>
</ul>
<p>4. When a object sends messages to an another object, the sender and the receiver are called the <em>client</em> and the <em>server</em>, respectively. A client needs to know nothing about the internal workings of a server.  A client needs to know only a server&#8217;s interface, that is, the list of the mothods supported by the server.</p>
<p>5. the list of the methods supported by the class.</p>
<p align="center">……………………</p>
<p><strong>5.2</strong></p>
<p>1. Mutator is a method used to change the value of an attribute of an object, such as a method to set a student&#8217;s name. Accessor is a method used to examine an attribute of an object without changing it, such as a method to get a student&#8217;s name.</p>
<p>2.</p>
<ul>
<li><code>private</code> : use to prevent clients from referring to the instance variable directly.</li>
<li><code>public</code> : use to allow clients to refer to the instance variable.</li>
</ul>
<p>3. A method that is run when an object is instantiated.</p>
<p>4. To construct and return a string representation of the student.</p>
<p>5.<br />
<code>s = new Student();</code><br />
<code>t = s;</code></p>
<p>6. A variable of a primitive type can be viewed as a box that contains a value of that primitive type. In contrast, a variable of a reference type is thought of as a box that contains a pointer to an object. The example of primitive types are <code>int</code>, <code>double</code>, <code>boolean</code>, <code>char</code>, etc. The example of reference types are all classes, for instance, <code>String</code>, <code>Scanner</code>, and so on.</p>
<p>7. A special value that indicates that no object can be accessed.</p>
<p>8. A situation that a program attempts to run a method with an object that is <code>null</code>. For example:<br />
<code>String str = null;</code><br />
<code>System.out.println(str.length());</code></p>
<p>9. A default constructor is a method that is provided by Java for creating objects of a class. The programmer can override this method to do extra things. In contrast, an addition constructor must be written by the programmer only.</p>
<p>10. The JVM will provides a primitive default constructor behind the scenes. This constructor initializes numeric variables to zero and object variables to <code>null</code>.</p>
<p>11. To initialize the instance variables of a newly instantiated object.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=13&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2007/10/18/101807/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>10/11/07</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2007/10/11/46/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2007/10/11/46/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 16:02:51 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/2007/10/11/46/</guid>
		<description><![CDATA[4.6 1. a) Display the power of 2 (21, 22, 23, &#8230;, 2limit) b) Compute 2(2expo-1) 2. a) for (int i=1; i&#60;=10; i++) System.out.println(i*i + " " + i*i*i); b) String str=""; for (int i=10; i&#62;=1; i--) str = str + i + " "; 3. a) Scanner reader = new Scanner(System.in); int i=1; while(i&#60;=5){ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=12&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>4.6 </strong></p>
<p>1.<br />
a) Display the power of 2 (2<sup>1</sup>, 2<sup>2</sup>, 2<sup>3</sup>, &#8230;, 2<sup>limit</sup>)<br />
b) Compute 2<sup>(2<sup>expo-1</sup>)</sup></p>
<p>2.<br />
a)<br />
<code>for (int i=1; i&lt;=10; i++)</code><br />
<code>System.out.println(i*i + " " + i*i*i);</code><br />
b)<br />
<code>String str="";</code><br />
<code>for (int i=10; i&gt;=1; i--)</code><br />
<code>str = str + i + " ";</code></p>
<p>3.<br />
a)<br />
<code>Scanner reader = new Scanner(System.in);</code><br />
<code>int i=1;</code><br />
<code>while(i&lt;=5){</code><br />
<code>System.out.print("Enter an integer: ");</code><br />
<code>int number = reader.nextInt();</code><br />
<code>System.out.println(Math.pow(number, 2));</code><br />
<code>i++;</code><br />
<code>}</code><br />
b)<br />
<code>int base = 2;</code><br />
<code>int count = expo;</code><br />
<code>while(count &gt; 1){</code><br />
<code>base=base*base;</code><br />
<code>count--;</code><br />
<code>}</code></p>
<p><strong>4.7</strong></p>
<p>1.<br />
a) Display the even numbers from 2 to <code>limit</code><br />
b) Let the user guess the number between 0-9 (inclusive) until correct</p>
<p>2.<br />
a)<br />
<code>for (int i=1; i&lt;=10; i++)</code><br />
<code>if(i % 2 == 1)</code><br />
<code>System.out.println(i*i + " " + i*i*i);</code><br />
b)<br />
<code>String str="";</code><br />
<code>for (int i=10; i&gt;=1; i--)<br />
</code><code>if(i % 2 == 0)</code><br />
<code>str = str + i + " ";</code></p>
<p><strong>4.8</strong></p>
<p>1. Open a scanner on file myfile.txt</p>
<p><strong>4.9</strong></p>
<p>1.<br />
a) if <code>limit</code> is an odd number, the program will not display <code>limit</code><br />
b) the program will work nonstop because the value of the variable <code>number</code> is never equal 10; it is always an odd numbers.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=12&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2007/10/11/46/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
		<item>
		<title>10/1/07</title>
		<link>http://sukolsaksakshuwong.wordpress.com/2007/10/01/10107/</link>
		<comments>http://sukolsaksakshuwong.wordpress.com/2007/10/01/10107/#comments</comments>
		<pubDate>Mon, 01 Oct 2007 15:09:29 +0000</pubDate>
		<dc:creator>sukolsaksakshuwong</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sukolsaksakshuwong.wordpress.com/2007/10/01/10107/</guid>
		<description><![CDATA[4.3 1. To make sure that she milks all cow. (To milk cow until there is no cow left in the west paddock) 2. To distinguish the red cow and the blue cow because she wants to milk cow that have different colors into different bottles. if (checker piece is red){ put in on a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=11&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>4.3</p>
<p>1.  To  make sure that she milks all cow. (To milk cow until there is no cow left in the west paddock)</p>
<p>2. To distinguish the red cow and the blue cow because she wants to milk cow that have different colors into different bottles.</p>
<ul>
<li>if (checker piece is red){<br />
put in on a red  square;<br />
}else{<br />
put in on a black  square;<br />
}</li>
<li>if(my shoes are muddy){<br />
take them off;<br />
leave them outside the door;<br />
}</li>
<li>while(there are any marbles on the floor){<br />
pick up a marble on the floor;<br />
put it into a bag;<br />
}</li>
</ul>
<p>3. a) swap the values of variable <code>x</code> and variable <code>y</code>. b) find the average of the absolute of data</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sukolsaksakshuwong.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sukolsaksakshuwong.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sukolsaksakshuwong.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sukolsaksakshuwong.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sukolsaksakshuwong.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sukolsaksakshuwong.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sukolsaksakshuwong.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sukolsaksakshuwong.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sukolsaksakshuwong.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sukolsaksakshuwong.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sukolsaksakshuwong.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sukolsaksakshuwong.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sukolsaksakshuwong.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sukolsaksakshuwong.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sukolsaksakshuwong.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sukolsaksakshuwong.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sukolsaksakshuwong.wordpress.com&amp;blog=1661005&amp;post=11&amp;subd=sukolsaksakshuwong&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sukolsaksakshuwong.wordpress.com/2007/10/01/10107/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/440b0027416f2190396a87c9bb9eedfd?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sukolsaksakshuwong</media:title>
		</media:content>
	</item>
	</channel>
</rss>
