<?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-21348259</id><updated>2011-12-17T21:45:11.721-07:00</updated><title type='text'>Anyone Can Write Computer Programs!</title><subtitle type='html'>Dedicated to training new programmers.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-21348259.post-2432589348820881430</id><published>2011-06-12T15:22:00.001-07:00</published><updated>2011-06-12T15:29:32.725-07:00</updated><title type='text'>Cooking up some new Posts!</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-P1RaoD7eIOA/TfU79WbhfGI/AAAAAAAADDI/use-9ijTOyQ/s1600/FDDNK246.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="140" src="http://1.bp.blogspot.com/-P1RaoD7eIOA/TfU79WbhfGI/AAAAAAAADDI/use-9ijTOyQ/s200/FDDNK246.png" width="200" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Cooking with Code and Logic&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a href="http://4.bp.blogspot.com/-UIHfCcTkvQc/TC_GPMuNu3I/AAAAAAAACsY/mPd2siXMhFw/s1600/DSC_0146.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;I&lt;/b&gt;&lt;/span&gt; want to apologize to the followers of this blog for its inactivity.  I have been working on a variety of projects over the past year but have recently refocused my efforts creating a new eBook for first-time programmers.&amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;This eBook will be much different than anything I have done before and will focus on small vignettes of introductory computer topics that I hope will eventually be published in the Kindle environment.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;I have for some time been talking about a textbook centered on 25 or so primary design patterns used by all programs. My thinking is that the 80-20 not only explains how many things work but how if also applies to programming.  In short, with just a little fundamental knowledge (a few design patterns) any programmer, even a new programmer, can create a lot of software applications.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-dEDwqOdwH5Y/TfU7tVypKoI/AAAAAAAADDA/O6LKtddej9w/s1600/FDDNK265.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-dEDwqOdwH5Y/TfU7tVypKoI/AAAAAAAADDA/O6LKtddej9w/s200/FDDNK265.png" width="153" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;In this new approach, I am also using a new metaphor. Rather than focusing on the techno- babble normally associated with software development, I am instead going to use &lt;b&gt;cooking as the guide&lt;/b&gt; for learning how to program.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;I have often used the analogy that a computer program is much like a recipe. I intend on taking that one step farther by using cooking (and eating) to explain sometimes complicated programming concepts.  This certainly meets the spirit of this blog that tries to help anyone who wants to learn how to write computer programs.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;So how was cooking like programming? I already explained how I used a recipe to define programming to new programmers. With a recipe, the instructions are sequential, they must be followed in order using ingredients and measurements as specified by the cook. Programmers must do much the same. The computer will only do what is told (by the programmer) and there's nothing built into the computer that will tell you when you're asked it to do something which doesn't make sense.&amp;nbsp; Create the incorrect logic steps and you will get a program that not do what you want it to do. A cook faces the same problem with a recipe. The recipe must be followed exactly and if you change the order of the recipe then the result will certainly be less than desirable,&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-vMs9B52kLmU/TfU7zz1aynI/AAAAAAAADDE/K4I0I8GARuY/s1600/SSP016D.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="146" src="http://1.bp.blogspot.com/-vMs9B52kLmU/TfU7zz1aynI/AAAAAAAADDE/K4I0I8GARuY/s200/SSP016D.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Cook's use seasonings and spices along with utensils and pans to create something to eat.  The programmer uses variables, constants. calculations, decisions, loops and expressions in much the same way.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In my cookbook of code, I will focus pseudo code.  Pseudo code looking and acting a lot like a recipe. An emphasis on the sequence of the instructions and not an syntax as is the case with computer programming languages.  My hope is that by using something that we all are familiar with, cooking, and pseudo code which is more like English sentences, that this will make programming easier for first timers and perhaps add clarity to those were having problems. Stay tuned, first up will be &lt;i&gt;&lt;b&gt;if statements &lt;/b&gt;&lt;/i&gt;( or decision structures).&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="cssButtonOuter"&gt;&lt;div class="cssButtonMiddle"&gt;&lt;div class="cssButtonInner"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/-vLYlzTAW5ho/TDK79P4tYMI/AAAAAAAACw0/OUxt2XTP_fU/s1600/DSC_0137.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="132" src="http://1.bp.blogspot.com/-vLYlzTAW5ho/TDK79P4tYMI/AAAAAAAACw0/OUxt2XTP_fU/s200/DSC_0137.JPG" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0in;"&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/21348259-2432589348820881430?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/2432589348820881430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=2432589348820881430' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/2432589348820881430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/2432589348820881430'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2011/06/cooking-up-some-new-posts.html' title='Cooking up some new Posts!'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-P1RaoD7eIOA/TfU79WbhfGI/AAAAAAAADDI/use-9ijTOyQ/s72-c/FDDNK246.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-2471357961761308377</id><published>2010-07-20T07:10:00.003-07:00</published><updated>2010-07-20T07:28:35.937-07:00</updated><title type='text'>My programming videos...</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8QiNaemP78E/TEWu7g3oEvI/AAAAAAAAC0g/orR8RJZNvuI/s1600/DSC_0218.JPG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 213px;" src="http://2.bp.blogspot.com/_8QiNaemP78E/TEWu7g3oEvI/AAAAAAAAC0g/orR8RJZNvuI/s320/DSC_0218.JPG" alt="" id="BLOGGER_PHOTO_ID_5495991257734320882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have a number of screen capture videos for Java, JavaScript, PYTHON and Visual Basic available in YouTube at&lt;a href="http://www.youtube.com/techtalkies"&gt; http://www.youtube.com/techtalkies&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You also subscribe from YouTube to post comments and see new videos.  They are also available on this blogs sidebar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-2471357961761308377?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/2471357961761308377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=2471357961761308377' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/2471357961761308377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/2471357961761308377'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2010/07/my-programming-videos.html' title='My programming videos...'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_8QiNaemP78E/TEWu7g3oEvI/AAAAAAAAC0g/orR8RJZNvuI/s72-c/DSC_0218.JPG' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-7480228336249157684</id><published>2008-12-08T09:45:00.017-07:00</published><updated>2008-12-08T10:34:09.716-07:00</updated><title type='text'>Modularization - Important Stuff</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8QiNaemP78E/ST1PYyjDgiI/AAAAAAAAAvA/r-qN2yXiu1Y/s1600-h/waikiki.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 198px;" src="http://2.bp.blogspot.com/_8QiNaemP78E/ST1PYyjDgiI/AAAAAAAAAvA/r-qN2yXiu1Y/s320/waikiki.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5277461625652347426" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;M&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;odularization&lt;/span&gt; has long been described to a "divide and conquer" approach to simplify complicated program logic.  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Modularization &lt;/span&gt;requires taking a program with many logic steps and simplifying it by looking for sub routines within the entire program that can stand by themselves (i.e. a sales tax calculation, GPA average calculation).  Sub routines can then be grouped with other sub routines to complete the entire program.  This approach has long been used in engineering. &lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;For example, when they designed the Space Shuttle, they did not design the entire space craft on a single drawing taking in all of the details in a single design. Instead, they broke the project up into pieces and designed each of those pieces with the idea of integrating them all at the end (i.e.  communications module, thrust module, launch module, space craft controls module, etc.).  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;The examples used in this blog are not as complicated as one would find in a typical program (so you may question why they would quality as a module) but the most important point to recognize is that these modules are typical of the blocks of code that exist in every program that really &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;constitute&lt;/span&gt; a part of the entire application.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="  "&gt;&lt;div id="ptt_" class="breakout" style="margin-top: 0px; margin-bottom: 0px; "&gt;&lt;p id="c0ez" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;b id="gse5"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'trebuchet ms';"&gt;Modularization: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'trebuchet ms';"&gt;Modularization defines the process of reviewing program logic to identify program &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;subtasks&lt;/span&gt;. When we divide the program up into &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;subtasks&lt;/span&gt; we make the design of logic simpler and more accurate. The logic contained within the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;subtasks&lt;/span&gt; is stored as modules. These modules are combined with statements to make up the program.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p id="m0c-" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'trebuchet ms';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div id="pknv" class="breakout" style="margin-top: 0px; margin-bottom: 0px; "&gt;&lt;p id="r2jq" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;b id="t-s4"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'trebuchet ms';"&gt;Modules:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'trebuchet ms';"&gt; A module is a block of code that represents a program &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;subtask&lt;/span&gt;. This &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;subtask&lt;/span&gt; is a standalone piece of code that performs part of the programs solution but also could stand by itself and potentially be used in other programs. For example, I could create a sub-task that calculates the sales tax of a purchase. It is only part of the logic but is required for the final solution. Because it can stand alone, it could be reused in other programs that have a similar requirement (i.e. other programs also would need to calculate sales tax).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Code Reuse&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Code reuse is perhaps the biggest benefit of modularization.  Code reuse can take place within a single program (In the case where lines of logic are called in multiple locations in your application) and also across different applications. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Taking a sales tax calculation; for a retail business, how many times does a computer need to calculate sales tax.  Could be at the cash register, could be used again to calculate that days sales tax liability, could be used again when printing monthly customer credit card invoices.  Why have the same calculation code statements called over and over again.  Instead, we could take a block of statements and execute that code block as a module in more than one program.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;This code reuse is a fundamental part of object orientated programming and a critical concept to understand and appreciate before learning to program with objects. There is also a quality benefit to code reuse.  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Can you see it?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;An Example&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Example the following pseudo code.  There are two modules identified here.  One for sales discount and one for sales tax.  In the diagram the pseudo code on the left is change to call modules that contain the code to be executed.  The new pseudo code that calls the module can be seen on the top right of the diagram.  By setting the code up in modules, the sales discount and sales tax code modules could be executed multiple times. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;hr /&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;img src="http://3.bp.blogspot.com/_8QiNaemP78E/ST1aBOVn0NI/AAAAAAAAAvQ/9sc4k1pOo6I/s320/modularization.png" style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 286px; height: 320px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5277473315423244498" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Next up will be some examples of &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;modularization&lt;/span&gt; in both Java and Visual Basic.Net.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" "&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;If you have a question or point to make, send me a comment.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style=" ;font-family:Verdana;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-7480228336249157684?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/7480228336249157684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=7480228336249157684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/7480228336249157684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/7480228336249157684'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/12/modularization-important-stuff.html' title='Modularization - Important Stuff'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_8QiNaemP78E/ST1PYyjDgiI/AAAAAAAAAvA/r-qN2yXiu1Y/s72-c/waikiki.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-4266215759466357229</id><published>2008-11-12T08:26:00.012-07:00</published><updated>2008-11-12T13:52:34.176-07:00</updated><title type='text'>Find and Replace ... Found!</title><content type='html'>&lt;a style="font-family: trebuchet ms;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8QiNaemP78E/SRr3U6tVz4I/AAAAAAAAAqI/OtRgJU7PXS4/s1600-h/DSC_0155.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 213px;" src="http://1.bp.blogspot.com/_8QiNaemP78E/SRr3U6tVz4I/AAAAAAAAAqI/OtRgJU7PXS4/s320/DSC_0155.jpg" alt="" id="BLOGGER_PHOTO_ID_5267794652892090242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;F&lt;/span&gt;&lt;/span&gt;ind and Replace is one of the more useful features you can add to a control that holds text.&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;  I created this VB form to do a find first, find next, replace and replace all support.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;The form was called as a modal form with &lt;span style="font-style: italic;"&gt;.showDialog&lt;/span&gt; and a screen shot of just the form can be seen below. The &lt;span style="font-weight: bold;"&gt;Replace&lt;/span&gt; button is not enabled until &lt;span style="font-weight: bold;"&gt;Find First&lt;/span&gt; is clicked and the &lt;span style="font-weight: bold;"&gt;Replace All &lt;/span&gt;button is available without clicking on the find button. &lt;span style="font-weight: bold;"&gt; Find Next&lt;/span&gt; is also disabled until the first string is found. Bottom line: you must click on&lt;span style="font-weight: bold;"&gt; Find First &lt;/span&gt;or &lt;span style="font-weight: bold;"&gt;Replace All &lt;/span&gt;before using the other buttons. The program was written with &lt;span style="font-weight: bold;"&gt;Microsoft Visual Studio 2008 in Visual Basic.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: trebuchet ms;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8QiNaemP78E/SRs2uFBQo4I/AAAAAAAAAqQ/r_POKYGNhkA/s1600-h/findreplace.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 400px; height: 179px;" src="http://2.bp.blogspot.com/_8QiNaemP78E/SRs2uFBQo4I/AAAAAAAAAqQ/r_POKYGNhkA/s400/findreplace.png" alt="" id="BLOGGER_PHOTO_ID_5267864354389271426" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Processing Logic&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;The program has been written to take advantage of some &lt;span style="font-style: italic; font-weight: bold;"&gt;richtextbox &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;control&lt;/span&gt; (mainForm.rtbBody) members (&lt;span style="font-weight: bold;"&gt;Find, Replace, SelectedText and  SelectionColor)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;" &gt; &lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;combined with some string functions.  &lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;The program is reasonably straight forward perhaps with the exception of the richtextbox &lt;span style="font-weight: bold;"&gt;Find &lt;/span&gt;method which needs a search string, a starting point (in chars) to search,the length of the search term and the type of match (wholeword, case, etc. - see VB documentation for richtextbox.find method). The starting point of the find changes to start just after the last find so that find next and replace all can continue to search through the textbox.&lt;br /&gt;&lt;br /&gt;You should be able to duplicate the form design and copy the code below into your application to test.   &lt;span style="font-style: italic;"&gt;Note:  I had to truncate some lines with continuation characters to fit inside blog post window. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As always in this blog:&lt;/span&gt; Use this program example at your own risk. This code was created for educational purposes only. The author provides programming code "as is" and provides no warranty or guarantee. If you have questions, If you can email the author at gmarrer@gmail.com&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;font-size:85%;"  &gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;" &gt;Visual Basic.Net 2008 Source Code&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt; (with Program Comments)&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;Public Class findreplace&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    'class instance variables&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    Private findText As String ' find text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    Private replaceText As String ' replace text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    Private selectionStart, selectionLen, lastStart As Integer   'position variables for search&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _&lt;br /&gt;               Handles btnClose.Click&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        'close form&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        Me.Close()&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    End Sub&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    Private Sub btnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _&lt;br /&gt;               Handles btnFind.Click&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        'if no text in find textbook&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        If txtFind.Text &lt;&gt; "' then" Then        &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'get ready to find the text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            findText = txtFind.Text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'find text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            selectionStart = mainForm.rtbBody.Find(findText, RichTextBoxFinds.WholeWord)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;            If selectionStart &lt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'text not found&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                MessageBox.Show(findText &amp;amp; "  Text Not Found", "Warning", MessageBoxButtons.OK, _&lt;br /&gt;                   MessageBoxIcon.Exclamation)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'turn on replace and find next&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                btnReplace.Enabled = True&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                btnFindNext.Enabled = True&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'set new start point for continued search&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                lastStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'start the selected text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'get len of selected text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionLength = findText.Length&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'mark selected text red in richtextbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionColor = Color.Red&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'No text in Find input textbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            MessageBox.Show("No find string entered. Please key in a value to find.", "Error", _&lt;br /&gt;              MessageBoxButtons.OK, MessageBoxIcon.Error)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            txtFind.Focus()&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    End Sub&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    Private Sub btnReplace_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _&lt;br /&gt;               Handles btnReplace.Click&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        'text in find textbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        If txtFind.Text &lt;&gt; "" Then  ' &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'text in replace textbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            If txtReplace.Text &lt;&gt; "" Then&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'get replace text from textbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                replaceText = txtReplace.Text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'replace selected text found with replacement text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectedText = replaceText&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'mark selected text red in richtextbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionColor = Color.Red&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'text in replace textbox missing&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                MessageBox.Show("No replace string entered. Please key in a value to find.", "Error", _&lt;br /&gt;                     MessageBoxButtons.OK, MessageBoxIcon.Error)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'put cursor in replace textbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                txtReplace.Focus()&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'text in find textbox missing&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            MessageBox.Show("No find string entered. Please key in a value to find.", "Error", _&lt;br /&gt;                    MessageBoxButtons.OK, MessageBoxIcon.Error)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'put cursor in find textbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            txtFind.Focus()&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    End Sub&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    Private Sub btnFindNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _&lt;br /&gt;               Handles btnFindNext.Click&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        'make sure find text is still there - mostly cosmetic&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        If txtFind.Text &lt;&gt; "' then" Then&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'find text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            selectionStart = mainForm.rtbBody.Find(findText, lastStart + findText.Length, _&lt;br /&gt;                   mainForm.rtbBody.TextLength, RichTextBoxFinds.WholeWord)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'no more occurances&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;            If selectionStart &lt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                MessageBox.Show(findText &amp;amp; "  No more occurances Found", "Warning", _&lt;br /&gt;                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'select and mark the found text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                lastStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionLength = findText.Length&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionColor = Color.Red&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'find input textbox is empty&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            MessageBox.Show("No find string entered. Please key in a value to find.", "Error", _&lt;br /&gt;                    MessageBoxButtons.OK, MessageBoxIcon.Error)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'put cusor in find textbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            txtFind.Focus()&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    End Sub&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    Private Sub btnReplaceAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _&lt;br /&gt;              Handles btnReplaceAll.Click&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;       &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        'find and replace textboxes should not be empty&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        If txtFind.Text &lt;&gt; "" And txtReplace.Text &lt;&gt; "" Then&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'store find text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            findText = txtFind.Text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'store replace text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            replaceText = txtReplace.Text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            selectionStart = 0&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'find first occarance&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            selectionStart = mainForm.rtbBody.Find(findText, RichTextBoxFinds.WholeWord)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'set new start point for continued search&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            lastStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'Text not found test&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;            If selectionStart &lt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                MessageBox.Show(findText &amp;amp; "  Text Not Found", "Warning", MessageBoxButtons.OK, _&lt;br /&gt;                       MessageBoxIcon.Exclamation)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'text found replace text and mark with red&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                lastStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionLength = findText.Length&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectedText = replaceText&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                mainForm.rtbBody.SelectionColor = Color.Red&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'Are there more occurances - loop until none or -1&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            While selectionStart &gt;= 0&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'search for text&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                selectionStart = mainForm.rtbBody.Find(findText, lastStart + findText.Length, _&lt;br /&gt;                       mainForm.rtbBody.TextLength, RichTextBoxFinds.WholeWord)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                'if no more occrances exit &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;                If selectionStart &lt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                    Exit While&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                    'set new start point for continued search&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                    lastStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                    'select text, replace and mark red&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                    mainForm.rtbBody.SelectionStart = selectionStart&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                    mainForm.rtbBody.SelectionLength = findText.Length&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                    mainForm.rtbBody.SelectedText = replaceText&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                    mainForm.rtbBody.SelectionColor = Color.Red&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;                End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            End While&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        Else&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'test must be in find and replace textboxes&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            MessageBox.Show("Find and Replace Text must both be entered into Textboxes.", _&lt;br /&gt;                      "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            'place cursor in find textbox&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;            txtFind.Focus()&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;        End If&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;    End Sub&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;End Class&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-4266215759466357229?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/4266215759466357229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=4266215759466357229' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/4266215759466357229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/4266215759466357229'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/11/find-and-replace-found.html' title='Find and Replace ... Found!'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8QiNaemP78E/SRr3U6tVz4I/AAAAAAAAAqI/OtRgJU7PXS4/s72-c/DSC_0155.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-8626704904722371106</id><published>2008-10-13T14:46:00.007-07:00</published><updated>2008-10-13T15:39:42.262-07:00</updated><title type='text'>Reading and Writing Parameter Files with VB/LINQ</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8QiNaemP78E/SPPCElmypHI/AAAAAAAAAlQ/gcPsU6ISFH4/s1600-h/DSC_0166.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_8QiNaemP78E/SPPCElmypHI/AAAAAAAAAlQ/gcPsU6ISFH4/s320/DSC_0166.jpg" alt="" id="BLOGGER_PHOTO_ID_5256758574141580402" border="0" /&gt;&lt;/a&gt; &lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;A&lt;/span&gt;&lt;/span&gt; little trickery with Visual Basic.Net 2008 this week.  &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://msdn.microsoft.com/en-us/library/bb384460.aspx"&gt;LINQ &lt;/a&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;" &gt;L&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;anguage &lt;/span&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;" &gt;in&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;tegrated &lt;/span&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;" &gt;q&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;uery is a new tool in the .Net toolbox.  Aside from providing a clever SQL like facility for filtering data, if you like &lt;a href="http://en.wikipedia.org/wiki/XML"&gt;XML&lt;/a&gt; for parameter files, it can provide a simple way of reading and writing application parameter data.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;I was using this the other day as I was providing application settings for a program I am working on.  I was looking for a quick way to store settings (autosave, defaultFont, defaultBrowser, etc.) for my application.  The program is still growing so at this point I am not sure I have isolated all of the application parameters I want to let my users save. I had a couple for sure and wanted to add more later.  XML was a easy way for my to keep track of what I have now and a way to add more later.  Here is the XML file I created.   Pretty standard.  XML version tag and then a well formed document.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;font-size:85%;"  &gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt;XML file - settings.xml&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;settings&amp;gt;&lt;br /&gt;&amp;lt;autosave&amp;gt;&lt;br /&gt;true&lt;br /&gt;&amp;lt;/autosave&amp;gt;&lt;br /&gt;&amp;lt;defaultbrowser&amp;gt;&lt;br /&gt;firefox&lt;br /&gt;&amp;lt;/defaultbrowser&amp;gt;&lt;br /&gt;&amp;lt;defaultfont&amp;gt;&lt;br /&gt;Arial&lt;br /&gt;&amp;lt;/defaultfont&amp;gt;&lt;br /&gt;&amp;lt;defaulttextcolor&amp;gt;&lt;br /&gt;black&lt;br /&gt;&amp;lt;/defaulttextcolor&amp;gt;&lt;br /&gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;The elements each represent a program setting (i.e. autosave).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;In my VB program I have a form I created that connects to a class module.  I use the class module to load and save the xml values. The class module allows my to reuse this code across other forms/classes/programs etc..  (If you look back into previous blog entries you will see some dicussion on class objects).&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;font-size:85%;"  &gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;As always in this blog:&lt;/span&gt; Use this program example at your own risk.  This code was created for educational purposes only. The author provides programming code "as is" and provides no warranty or guarantee. If you have questions, If you can email the author at  gmarrer@gmail.com&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;font-size:85%;"  &gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;blue - Vb statements&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-family:arial;" &gt;red - LINQ&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:arial;" &gt;green - XML&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;Here is the load method for the XML:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:arial;"&gt;Class module called SettingsClass&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;&lt;span style="font-family:arial;"&gt;Public Class SettingsClass  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  &lt;span style="font-weight: bold;"&gt;  'instance variables&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    Private cAutosave As Boolean&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    Private cdefaultFont As String&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    Private cdefaultBrowser As String&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    Private cdefaultTextColor As String&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;&lt;span style="font-family:arial;"&gt; (code removed here...)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);font-size:85%;" &gt;&lt;span style="font-family:arial;"&gt;   &lt;span style="color: rgb(0, 0, 153);"&gt; Public Sub loadXML()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;      &lt;span style="color: rgb(0, 102, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 102, 0);"&gt; 'declare and define xml doc type&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;&lt;span style="color: rgb(0, 102, 0);"&gt;        Dim mySettings As New XDocument&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      &lt;span style="color: rgb(0, 102, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 102, 0);"&gt; 'point to settings.xml file&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;        mySettings = XDocument.Load("settings.xml")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; 'dimension object to hold elements. F&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;font-family:arial;" &gt;or this app, there is only one row entry holding four elements.&lt;br /&gt;'&lt;span style="color: rgb(204, 0, 0);"&gt;LINQ is used to assign data from the XML file. The LINQ expression is on the right side of the =&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;&lt;span style="font-family:arial;"&gt;        Dim xmlSetting = &lt;span style="color: rgb(204, 0, 0);"&gt;From x In mySettings...&lt;settings&gt;&lt;/settings&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;       &lt;span style="font-weight: bold;"&gt; 'use try to process runtime&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; errors&lt;/span&gt;&lt;br /&gt;Try&lt;br /&gt; &lt;span style="font-weight: bold;"&gt;  'read each entry in list - only one for this app&lt;/span&gt;&lt;br /&gt;   For Each valueItem In xmlSetting&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;              &lt;span style="font-weight: bold;"&gt;  'one variable for each XML element.  the elements are retrieved as string datatype&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;                'convert autosave from string to boolean&lt;/span&gt;&lt;br /&gt;       If &lt;span style="color: rgb(204, 0, 0);"&gt;valueItem.&lt;autosave&gt;.Value&lt;/autosave&gt;&lt;/span&gt; = "true" Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;                    cAutosave = True&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;                Else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;                    cAutosave = False&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;                End If&lt;br /&gt;   &lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;    'autosave, defaultFont, defaultBroser, defaultTextColor are XML elements&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;                cdefaultFont = &lt;span style="color: rgb(204, 0, 0);"&gt;valueItem.&lt;defaultfont&gt;.Value&lt;/defaultfont&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;                cdefaultBrowser =&lt;span style="color: rgb(204, 0, 0);"&gt; valueItem.&lt;defaultbrowser&gt;.Value&lt;/defaultbrowser&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;                defaultTextColor = &lt;span style="color: rgb(204, 0, 0);"&gt;valueItem.&lt;defaulttextcolor&gt;.Value&lt;/defaulttextcolor&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;            Next&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;'process anty runtime exceptions - you can customize this will multiple catch blocks&lt;/span&gt;&lt;br /&gt;Catch ex As Exception&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;            MessageBox.Show("Settings File Loading Error", "File Open/parse Error", MessageBoxButtons.OK, MessageBoxIcon.Error)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;        End Try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;    End Sub&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;Now lets look at the save method to see how the XML settings file is saved. Note: a new file is created rather than updating the original.  You might want to make a backup as part of your application processing.&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-size:85%;" &gt;&lt;span style="font-family:arial;"&gt;Public Sub saveXML()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;       &lt;span style="font-weight: bold;"&gt; ' working local variables &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        Dim newXML As String&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; 'turn on exception handling&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        Try&lt;br /&gt; &lt;span style="font-weight: bold;"&gt;  'assign XML text to string variable to be written out later. Note the use of underscore _ continuation character &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;            newXML = &lt;span style="color: rgb(0, 102, 0);"&gt;"" &amp;amp; vbCrLf &amp;amp; _&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:arial;" &gt;"&lt;settings&gt;" &amp;amp; vbCrLf &amp;amp; _&lt;/settings&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:arial;" &gt;"&lt;autosave&gt;" &amp;amp; cAutosave &amp;amp; "&lt;/autosave&gt;" &amp;amp; vbCrLf &amp;amp; _&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:arial;" &gt;"&lt;defaultbrowser&gt;" &amp;amp; cdefaultBrowser &amp;amp; "&lt;/defaultbrowser&gt;" &amp;amp; vbCrLf &amp;amp; _&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:arial;" &gt;"&lt;defaultfont&gt;" &amp;amp; cdefaultFont &amp;amp; "&lt;/defaultfont&gt;" &amp;amp; vbCrLf &amp;amp; _&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:arial;" &gt;"&lt;defaulttextcolor&gt;" &amp;amp; cdefaultTextColor &amp;amp; "&lt;/defaulttextcolor&gt;" &amp;amp; vbCrLf &amp;amp; _&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;""&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;   ' write string to settings.xml text file&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;            My.Computer.FileSystem.WriteAllText("settings.xml", newXML, False)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        Catch ex As Exception&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            MessageBox.Show("Settings File Saving Error", "File Save Error", MessageBoxButtons.OK, MessageBoxIcon.Error)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        End Try&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    End Sub&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;You can still process you setting files with file streaming but I like this soltuion because the structure of the XML makes is more like a record and there are very few lines of code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Look it over... How would look it it was C#?&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:arial;font-size:85%;"  &gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-8626704904722371106?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/8626704904722371106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=8626704904722371106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/8626704904722371106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/8626704904722371106'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/10/reading-and-writing-parameter-files.html' title='Reading and Writing Parameter Files with VB/LINQ'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_8QiNaemP78E/SPPCElmypHI/AAAAAAAAAlQ/gcPsU6ISFH4/s72-c/DSC_0166.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-7871700829562073350</id><published>2008-10-06T13:44:00.005-07:00</published><updated>2008-10-06T15:01:38.430-07:00</updated><title type='text'>A Piece of Pie with your Java</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8QiNaemP78E/SOqCDg9jjZI/AAAAAAAAAkU/NnkWaOyamf0/s1600-h/DSC_0175.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_8QiNaemP78E/SOqCDg9jjZI/AAAAAAAAAkU/NnkWaOyamf0/s320/DSC_0175.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5254154912180440466" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;In this installment of &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;ACWCP&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; with programming examples, I am presenting a Java application that creates a simple pie chart.  &lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;This version of the application extends &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;JFrame&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; to create a driver class (with main method) so that the calculations and logic in the paint method will &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;draw&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; a simple &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;pie&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; chart.  It asks the user to input four values and then does the math to paint a pie chart with four slices.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;You can change and use the code anyway you would like but understand it is use at your own risk with no warranties or guarantees (legal stuff).    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;The program starts with the main method.  It will ask the user via &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;JOptionPane&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; input dialog boxes for four values.  These values will be included in the declare/&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;instantiation&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; of &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;JFPieChart&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; as part of the constructor.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;The constructor is called first.  The values are passed as strings and converted to integers.  A try/catch block makes sure that if a string number is not passed that the application will not abort with a &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;runtime&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; error.  &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;NumberFormatException&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; handling was added to allow for a more graceful exit.  You may want to change the code in the catch block depending on your application. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;The paint method is called by the &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;runtime&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; environment whenever it needs to repaint the items in the paint method.  Variables changed in your constructor will cause the paint method to fire and paint the sections of pie with the same point of origin.  This has the effect of creating a pie wheel of pie slices.  The last activity is to place a legend and title at the side and bottom of the window frame.  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;The Code:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// Gary &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;Marrer&lt;/span&gt; - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;JFPieChart&lt;/span&gt;.java&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// October 2008&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// Use this program example at your own risk.  This code was created for educational purposes only.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// The author provides programming code "as is" and provides no warranty or guarantee. If you have questions,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// you can email the author at  gmarrer@gmail.com&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;//  import relevant package files&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;import javax.swing.*;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;import java.awt.*;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;import java.awt.geom.*;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// extend &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;JFrame&lt;/span&gt; to test pie chart creation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// you can use the constructor and paint method in other classes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;public class &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;JFPieChart&lt;/span&gt; extends &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;JFrame&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// class instance variables&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// used by multiple methods inside this class&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;private int a, b, c, d, ax, bx, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;cx&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;dx&lt;/span&gt;, tot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;private static String first, second, third, forth;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// constructor sets private instance variables&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;    public &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;JFPieChart&lt;/span&gt;(String v1, String  v2, String v3, String v4)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;    {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// turn on exception handling for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;NumberFormatException&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        try&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;//convert String values to int for pie chart calculation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;a = Integer.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;parseInt&lt;/span&gt;(v1);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;b = Integer.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;parseInt&lt;/span&gt;(v2);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;c = Integer.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;parseInt&lt;/span&gt;(v3);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;d = Integer.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;parseInt&lt;/span&gt;(v4);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// add the values&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;tot = a + b + c + d;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// calculate pie section&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;ax = (360 * a) / tot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;bx = (360 * b) / tot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;cx&lt;/span&gt; = (360 * c) / tot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;dx&lt;/span&gt; = (360 * d) / tot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// exception handling&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        catch (NumberFormatException e)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;                JOptionPane.showMessageDialog(null, "Error Message- Number Format Exception: " + e.getMessage(), "Error message",JOptionPane.ERROR_MESSAGE);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        catch (Exception e)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;                 JOptionPane.showMessageDialog(null, "Unknown Error Message - Aborting " + e.getMessage(), "Error message",JOptionPane.ERROR_MESSAGE);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;    } // end JFPieChart&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// paint called by system when screen needs refreshing&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;    public void paint(Graphics g)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;    {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;//  used to create Java2D API environment&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;Graphics2D g2d = (Graphics2D) g;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// Chart Title - set font, color and background&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; g.setFont(new Font("Arial", Font.BOLD, 16));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; g.drawString("Sample Pie Chart",15,200);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; g.setColor(Color.black);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; g.fillRect(0,0,500,500);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;//  Start Java2D code&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// set colors, stroke and location of point to anchor pie slice&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// place each pie slice next to the other&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.setPaint(Color.blue);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.setStroke( new BasicStroke(1.0f));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.fill(new Arc2D.Double(15,35, 80, 80, 0 , ax, Arc2D.PIE));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.setPaint(Color.orange);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.setStroke( new BasicStroke(1.0f));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.fill(new Arc2D.Double(15,35, 80, 80, 0 + ax, bx, Arc2D.PIE));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.setPaint(Color.green);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.setStroke( new BasicStroke(1.0f));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.fill(new Arc2D.Double(15,35, 80, 80, 0 + ax + bx, cx, Arc2D.PIE));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.setPaint(Color.white);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.setStroke( new BasicStroke(1.0f));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g2d.fill(new Arc2D.Double(15,35, 80, 80, 0 + ax + bx + cx , dx, Arc2D.PIE));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;//  draw Legend - color&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g.setColor(Color.white);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g.drawString( "Value 1 = " + a  ,250,50);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g.drawString("Value 2 = " + b ,250,100);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g.drawString("Value 3 = " + c ,250,150);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;g.drawString("Value 4 = " + d ,250,200);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;    } // end paint&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// main is used in this program to provide input to the pie chart&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;//drawing routines&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;     public static void main(String args[])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; // ask user for four values&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;first = JOptionPane.showInputDialog("Enter First Number");&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        second = JOptionPane.showInputDialog("Enter Second Number");&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        third = JOptionPane.showInputDialog("Enter Third Number");&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;        forth = JOptionPane.showInputDialog("Enter Forth Number");&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// insatiate the class and call constructor. Pass four user values.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;JFPieChart pie = new JFPieChart(first, second, third, forth);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// size of frame&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;pie.setSize(500,500);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// close app when frame is closed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;pie.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;// make pie chart visible - this needs to be last statement before Frame is displayed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;pie.setVisible(true);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;} // end main&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 153);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;Run it, change it and include it in your programs.  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;If you have a comment, send it along as a comment.  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;Happy Programming...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;p.s. Anyone know where the picture came from?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-7871700829562073350?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/7871700829562073350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=7871700829562073350' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/7871700829562073350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/7871700829562073350'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/10/piece-of-pie-with-your-java.html' title='A Piece of Pie with your Java'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_8QiNaemP78E/SOqCDg9jjZI/AAAAAAAAAkU/NnkWaOyamf0/s72-c/DSC_0175.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-3896611279736551076</id><published>2008-10-04T18:01:00.005-07:00</published><updated>2008-10-04T18:18:12.131-07:00</updated><title type='text'>Content Change</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8QiNaemP78E/SOgShIiaLXI/AAAAAAAAAkM/okCXyqIXjRs/s1600-h/DSC_0216.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_8QiNaemP78E/SOgShIiaLXI/AAAAAAAAAkM/okCXyqIXjRs/s320/DSC_0216.jpg" alt="" id="BLOGGER_PHOTO_ID_5253469325764472178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;T&lt;/span&gt;&lt;/span&gt;he &lt;span style="font-weight: bold;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;ACWCP&lt;/span&gt;&lt;/span&gt; blog has so far, for the most part, been programming &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;language&lt;/span&gt; neutral.  I have focused on programming concepts (structured and object orientated programming) and stayed away from examples in specific programming languages.  This has probably limited the number of posts I have placed in the blog since the focus was no general concepts alone.  There was not a lot of details or specific code snippets to illustrate the example in programming code.  This is going to change.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Working forward, I will include examples of &lt;span style="font-weight: bold;"&gt;Java&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Visual Basic&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;C#&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;PYTHON&lt;/span&gt; in the blog.  In some cases, I will demonstrate a concept in a particular &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;languages&lt;/span&gt; and in other cases, I will show two languages side by side (a comparison so to speak).  This is all in hopes of making the blog more interesting and also provide the raw material for future blogs.  Watch next week as my first blog entry with this new focus.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms; font-style: italic; color: rgb(0, 0, 102);"&gt;Let me know what you think on my plan... If there is something you have a question about or and example you would like review, send a comment. &lt;/span&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 102);"&gt;I will try to post it to the blog.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-3896611279736551076?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/3896611279736551076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=3896611279736551076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/3896611279736551076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/3896611279736551076'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/10/content-change.html' title='Content Change'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8QiNaemP78E/SOgShIiaLXI/AAAAAAAAAkM/okCXyqIXjRs/s72-c/DSC_0216.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-7680559345044735686</id><published>2008-08-27T15:58:00.010-07:00</published><updated>2008-09-09T19:38:10.194-07:00</updated><title type='text'>Programmers: Why should we start with a plan...?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8QiNaemP78E/SLXhJ5uORdI/AAAAAAAAAYs/6dgt9XB4PM8/s1600-h/IMG_4459.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_8QiNaemP78E/SLXhJ5uORdI/AAAAAAAAAYs/6dgt9XB4PM8/s200/IMG_4459.jpg" alt="" id="BLOGGER_PHOTO_ID_5239341301745206738" border="0" /&gt;&lt;/a&gt;&lt;span style=";font-family:&amp;quot;;font-size:100%;"  &gt;&lt;span style="font-weight: normal; font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;M&lt;/span&gt;ost of the software development tools we have today include visual designers (that contain dozens of visual screen components) that allow us to prototype our user interfaces.  By prototyping we can see what our user's see and greatly improve the quality of our interface and also reduce the time needed to built graphical interfaces. This is a GOOD thing but like everything it can be abused.  Prototyping the user interface is no substitute for planning the logic that sits behind the screen.  This blog topic addresses this issue.&lt;/span&gt;&lt;/span&gt;&lt;h1  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;If you are going to be a programmer you have got to plan...&lt;/span&gt;&lt;span style="font-weight: normal; font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Why&lt;/span&gt; do we construct logic models (flow charts and pseudo code) to create computer programs? This is certainly a very valid question and one I have heard many times from programming students. I’ve had many new student programmers who have been in a rush to program. This is a very natural reaction. Our enthusiasm to get started along with the uncertainty of learning a new subject, drive our desire to create our first program. It is difficult to stay patient as we move through the topics of flow charting and pseudo code knowing that you can open that editor and start building your screens or writing your code.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(51, 0, 153);"&gt;Resist&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;the temptation for a little while longer as we again discuss the discipline of programming. The adage &lt;span style="font-style: italic;"&gt;“anything worth having is worth waiting for”&lt;/span&gt; is very appropriate explanation of where we are at in your programming training. A little patience now is important as we build a foundation that will help you become a more effective and efficient programmer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;I covered in other blogs about the &lt;span style="font-weight: bold; font-style: italic;"&gt;discipline of programming&lt;/span&gt;. I explained that having discipline as a programmer meant approaching programming with a &lt;span style="font-weight: bold; font-style: italic;"&gt;professional standardized process&lt;/span&gt;. This discipline has been used by other programmers and has evolved over time from numerous successful programming projects. This is not unlike the professional standards and processes developed by accountants, lawyers, engineers and other professionals.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(102, 0, 204); font-style: italic;"&gt;There are many analogies I could use to demonstrate how program discipline is exhibited and why it is important. One of my favorites is building a house from scratch.  We all know what a house looks like and we could go down to the local hardware store and buy the supplies and start putting together a house. Without following the standards used by professional builders (blueprints, accepted construction techniques, building code regulations), we might end up with something that looks like a house (a structure with a roof and four walls) but it’s unlikely that it would be of the quality that was found in a house built by a professional. It might have an unsafe design. We might not be able to remodel or repair the house later on because of its non-standard construction. It would a structure that would probably not stand the test of time like a house built using established standards and techniques.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic; color: rgb(153, 51, 153);"&gt;How about another analogy? Are you the kind of person who doesn’t like to read directions? Do you buy a product from the store and instead of reading over the assembly instructions you simply start putting things together based on the picture on the box? When it comes to installing new software from a CD-ROM to your personal computer, do you just place the CD-ROM in the drive and take all the defaults or do you read the instructions on how to install it properly. Most of the time, the software installs okay. Sometimes the original install seems successful and after awhile you realized the software was not installed correctly and you have to reinstall again. Normally the reinstall is not a problem but you had customized your software settings, the new install will probably wipe them out so that you will need to reconfigure them again. This will be the penalty for your haste. This is why the &lt;span style="font-weight: bold;"&gt;discipline of programming&lt;/span&gt; is so important to becoming an effective programmer.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;If you do not take the time to use good programming processes during your project (like building logic models first) and you might find a serious problem later on after the program has been in use. This is the worst kind and most embarrassing type of programming design error. Programs that require a lot of rework and repair just after installation are poorly designed programs and a sure sign that &lt;span style="font-weight: bold;"&gt;programming discipline&lt;/span&gt; was not followed.&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;What do you think?  Ready to build at flowcharts?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-7680559345044735686?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/7680559345044735686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=7680559345044735686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/7680559345044735686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/7680559345044735686'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/08/programmers-why-should-be-start-with.html' title='Programmers: Why should we start with a plan...?'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8QiNaemP78E/SLXhJ5uORdI/AAAAAAAAAYs/6dgt9XB4PM8/s72-c/IMG_4459.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-7206614152792757301</id><published>2008-08-04T15:38:00.006-07:00</published><updated>2008-08-04T16:15:46.837-07:00</updated><title type='text'>Multi Dimension Arrays - the double subscript</title><content type='html'>As you would have seen from earlier posts, a single dimension array looks much like many boxes stacked on top of one another. All single dimension arrays have one column and many rows. It is also possible to create multi-dimensional arrays. The most common of these multi-dimensional arrays are two dimensional arrays which have multiple columns and multiple rows (much like a spreadsheet has rows and columns). In addition, you can also work with arrays that are three and four dimensions but these arrays are difficult to conceptualize and outside what we can cover in this post. We concentrate on single dimension arrays in our case studies but we will spend a little time in understanding how single and two dimensional arrays are different.&lt;br /&gt;&lt;br /&gt;When accessing elements in a two dimensional array, I have two subscripts. One subscript identifies the row and the second subscript identifies the column. Below, I have created a graphic showing a two dimensional array with the array subscripts identified in the diagram.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_8QiNaemP78E/SJeJB3TF9yI/AAAAAAAAAXY/DE_e0e-mzuI/s1600-h/multiArray.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp1.blogger.com/_8QiNaemP78E/SJeJB3TF9yI/AAAAAAAAAXY/DE_e0e-mzuI/s320/multiArray.jpg" alt="" id="BLOGGER_PHOTO_ID_5230800157331027746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;Figure 3: A multi-dimensional array diagrammed&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;&lt;o:p&gt;The declaration of a two dimensional array is similar to a one dimensional array as the code statement below illustrates:&lt;o:p&gt;&lt;/o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;oneDimArray[10]&lt;br /&gt;twoDimArray[10][5]&lt;/pre&gt;&lt;span style=""&gt;The single dimension array named oneDimArray has ten elements with subscripts 0 through 9. The two dimension arrays of the named twoDimArray has 50 elements with subscripts addresses 0,0 to 4,9. The two dimension array also has subscripts and that start at 0. The difference is in the fact that with a single dimension array you have one subscript and with the Multi-Dimensional array you have at least two subscripts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p&gt;&lt;span style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt;In regards to assigning a value to a two dimensional array the same rules As with a single dimension array also apply. To store a value of 10 in the 3rd row 2nd column of an array called twoDimArray would look like the following in pseudo code:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt;twoDimArray(2,1) = 10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt;Take note of the subscripts. They are one less than the rows and columns requested above. This is to compensate for the fact that multi dimensional arrays also start with 0 for both the first row and first column.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-7206614152792757301?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/7206614152792757301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=7206614152792757301' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/7206614152792757301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/7206614152792757301'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/08/multi-dimension-arrays-double-subscript.html' title='Multi Dimension Arrays - the double subscript'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_8QiNaemP78E/SJeJB3TF9yI/AAAAAAAAAXY/DE_e0e-mzuI/s72-c/multiArray.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-1502315888521256112</id><published>2008-07-25T16:11:00.007-07:00</published><updated>2008-07-25T16:37:37.294-07:00</updated><title type='text'>A Sample Problem to Illustrate the Flexibility of Arrays</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_8QiNaemP78E/SIpiXsWmtsI/AAAAAAAAAWo/9MGVqFOD7yc/s1600-h/cat5.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp0.blogger.com/_8QiNaemP78E/SIpiXsWmtsI/AAAAAAAAAWo/9MGVqFOD7yc/s320/cat5.jpg" alt="" id="BLOGGER_PHOTO_ID_5227098476699367106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=""&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;font-size:130%;"  &gt;The benefits of using Arrays ...&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=""&gt;You’d been asked to create a program for your computer programming instructor that calculates the average test score of the mid-terms she has just graded. Your programming class has fifteen students but she has informed you that this program needs to work for all of her classes. Her other classes have 10 students and 25 students respectively. She needs one program for all three classes and you should design the program so that the teaching assistant can specify the number of students and then input each test score from the keyboard. When the last score has been entered into the program, all of the test scores will be displayed along with the average calculation and the sum of all inputted scores. You have been told that the program needs to include a single dimension array to hold the students scores. The array will enable you to set the number of test scores averaged at run-time. Your solution should include Pseudo code of the logic model.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p&gt;&lt;span style=""&gt;In the pseudo code example below, we introduce new code to our logic model. Since we have broadened our variables to include array data types, I have created a block of pseudo code dedicated to the variable declaration and initialization. We define an empty array called grades[]. Empty brackets are an indication that the array has not been sized. The brackets are typically the place where subscripts are located.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;start&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;declare variables&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;char elementCnt&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;char newMember&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;num testTotal equals 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;num i equals 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;num grades[]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;input Enter the number of Tests into elementCnt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;for i = 0 to  (elementCnt - 1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;grades[i] = 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;input "Enter Score &gt;&gt; into grades [i]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;testTotal equals testTotal plus grades [i]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;     i equals 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;for i = 0 to  (elementCnt - 1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;print Test Score  plus i plus  equals  plus grades [i]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;print "Total &gt;&gt; " plus testTotal&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;print "Average &gt;&gt; " plus (testTotal / elementCnt)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;  &lt;p style="color: rgb(102, 51, 51);"&gt;&lt;span style=""&gt;- Here the pseudo code identifies an array of data type number called grades[]. This is where the student test scores will be stored as elements. The array is currently empty.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="color: rgb(102, 51, 51);"&gt;&lt;span style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="color: rgb(102, 51, 51);"&gt;&lt;span style=""&gt;- This for loop will ask for input and store the test values within the array. The array size is equal to the number of elements stored in the elementCnt variable. Sizing the array at run-time allows us to run the program with a different number of test scores on each execution. Note the construction of a for loop where the variable i is the incrementor variable. This variable will start at 0 (for the first subscript) and exit the loop when i is one less than the total number of elements. It will exit one less then the total elements because the subscripts start at 0 and not 1 (like elements).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="color: rgb(102, 51, 51);"&gt;&lt;span style=""&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="color: rgb(102, 51, 51);"&gt;&lt;span style=""&gt;- Here we have one final for loop to print the contents of each element in the array along with the print statement for both the test total variable and no one of the test average&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Questions?&lt;/span&gt;&lt;/p&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);font-family:trebuchet ms;" &gt;Do these examples help?  Send a comment one way or the other.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-1502315888521256112?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/1502315888521256112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=1502315888521256112' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/1502315888521256112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/1502315888521256112'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/07/sample-problem-to-illustrate.html' title='A Sample Problem to Illustrate the Flexibility of Arrays'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_8QiNaemP78E/SIpiXsWmtsI/AAAAAAAAAWo/9MGVqFOD7yc/s72-c/cat5.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-5018911497572349496</id><published>2008-07-17T15:07:00.008-07:00</published><updated>2008-07-17T16:07:07.499-07:00</updated><title type='text'>Everybody's problem: Arrays</title><content type='html'>&lt;span style="color: rgb(128, 0, 64);font-size:85%;" &gt;If there is one topic that I always get allot of questions about, it is arrays.  I think the scary thing about arrays is that they look like algebra.  The index used to indentify the element brings back all of the fears and insecurities associated with those of us who are math averse.&lt;/span&gt;..&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Arrays Defined&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;Arrays&lt;/b&gt;&lt;/i&gt; are specialized data structures which allow us to build a collection of variables. The variables in this collection are called &lt;u&gt;elements &lt;/u&gt;and they're all referred to by the same array name. What differentiates the elements in the array is a&lt;u&gt; subscript or index&lt;/u&gt;. The subscript acts as an address to uniquely identify each element in the array. For most languages, the size of the array or the number of elements it may hold is set when the array is declared. The size of the array cannot be changed (however, you can copy smaller arrays into larger arrays.) In addition, most programming languages require that all of the elements in the array have the same data type. In other words, if the array is of type number all of the elements must also be number values. Arrays are not restricted to just numbers and characters. Arrays may also contain elements of other data types like arrays, structures or objects (i.e. an array of arrays or an array of structures).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Arrays Used&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;as mentioned="" values="" of="" array="" stored="" these="" are="" identified="" uniquely="" by="" their="" subscript="" or="" in="" the="" following="" i="" have="" graphically="" represented="" five="" elements="" which="" each="" hold="" a=""&gt;&lt;i&gt; For most programming languages, array elements start with a number zero and increase by one the subscripts must be numeric and they must be integer best provide a unique address for each element &lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.laptoppress.com/fop/wikiimages/ch6/array.png" title="Array Diagram" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;&lt;span style="font-size:100%;"&gt;An example in PYTHON&lt;/span&gt;&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;When working with individual elements of the array, we need both the name and the subscript of the element. If we wanted to replace the value in the third element, which has a subscript of two, we could generate a statement similar to the following:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=";font-family:Arial,Helvetica,sans-serif;font-size:100%;"  &gt;myArray(2) = test value&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;myArray is the array name &lt;/li&gt;&lt;br /&gt;&lt;li&gt;the right and left parenthesis or bracket enclose the subscript &lt;/li&gt;&lt;br /&gt;&lt;li&gt;the equals (=) sign indicates an assignment where the character constant test value is stored in the third element of myArray&lt;/li&gt;&lt;/ul&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Next up:&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Multidimensional arrays and parallel arrays.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.laptoppress.com/" title="Laptop Press, LLC" target="_blank"&gt;Laptop Press, LLC  - More on programming at www.laptoppress.com&lt;/a&gt;&lt;/as&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-5018911497572349496?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/5018911497572349496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=5018911497572349496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/5018911497572349496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/5018911497572349496'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/07/everybodys-problem-arrays-if-there-is.html' title='Everybody&apos;s problem: Arrays'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-1343980127313997559</id><published>2008-07-14T16:25:00.002-07:00</published><updated>2008-07-14T16:34:48.866-07:00</updated><title type='text'>Some Blog Changes and Updates</title><content type='html'>This blog has been inactive for some time.  I originally started the blog to post sections on a book I had written on programming.  I did this to promote programming and my eBook. The blog has received a number of hits over time and I have decided to activate the blog with put new content.&lt;br /&gt;&lt;br /&gt;I will continue to post sections of my book but I will also mix in questions from readers.  I have begun a tutoring service to help programming students &lt;a href="http://tutor.garymarrer.com"&gt;tutor.garymarrer.com&lt;/a&gt; and I will be using the blog with this tutoring site to promote programming and my work tutoring students.&lt;br /&gt;&lt;br /&gt;I will also be changing the design of the blog and adding new content and features.  It will also be more closely integrated with my tutoring web page.&lt;br /&gt;&lt;br /&gt;If you have a topic on programming you would like covered.  Post a comment or send me an email at &lt;a href="mailto:gary.marrer@gmail.com"&gt;gary.marrer@gmail.com&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-1343980127313997559?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/1343980127313997559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=1343980127313997559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/1343980127313997559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/1343980127313997559'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2008/07/some-blog-changes-and-updates.html' title='Some Blog Changes and Updates'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-8308136478273602830</id><published>2007-06-26T16:38:00.002-07:00</published><updated>2008-07-16T09:57:07.660-07:00</updated><title type='text'>Why we learn OOP</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_8QiNaemP78E/RoGk6Vn3tfI/AAAAAAAAAEY/-2LWrJSpYPE/s1600-h/DSC_0133.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5080523176794371570" style="FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer" alt="" src="http://bp3.blogger.com/_8QiNaemP78E/RoGk6Vn3tfI/AAAAAAAAAEY/-2LWrJSpYPE/s320/DSC_0133.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2 style="FONT-FAMILY: trebuchet ms"&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style="FONT-FAMILY: trebuchet ms"&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 face="trebuchet ms"&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 face="trebuchet ms"&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 face="trebuchet ms"&gt;&lt;br /&gt; &lt;/h2&gt;&lt;h2 style="FONT-FAMILY: trebuchet ms"&gt;The why of OOP?&lt;/h2&gt;&lt;p style="FONT-FAMILY: trebuchet ms"&gt;Before we learn the techniques necessary to program with objects, it is important to understand why OOP has become such an important part of application programming. The use of class objects has become a very important tool in the programmer’s toolbox and understanding OOP may make the difference in securing that first programming position or promotion.&lt;/p&gt;&lt;p style="FONT-FAMILY: trebuchet ms"&gt;Let us look at OOP from a very practical standpoint using a business example. Historically, computer software has always been a labor intensive activity. It takes many hours for programmers to develop high-quality and efficient software. Rush the development process and you can be assured that logic mistakes will prevail thus creating an unreliable program. Most companies have had problems dealing with a software development backlog. What this means is that the requests for new software outstretch the ability of the programming staff to create new programs and maintain existing software. Using existing structured programming techniques alone might extend an already overburdened programming staff or rush the process at the sacrifice of quality.&lt;/p&gt;&lt;span style="font-family:trebuchet ms;"&gt;Today, most companies use their computer systems for strategic advantage and competitiveness. If a company is not able to respond to its competition or to a market opportunity with new systems, it will suffer via lower profits, lost customers, or decreasing market share. The main challenge of most software development managers is to deal with the software development backlog. Any software development tools or techniques that would allow programmers to become more efficient and productive will always be seen as a great benefit since it can only help the company's ability to compete. With OOP, one of its main benefits is the ability of programmers to create snippets of code called class objects that can be reused across many applications. In short, these generic code snippets combine key variables and modules into containers called class objects so that they can be used in more than one program.&lt;br /&gt;&lt;br /&gt;Agree? Questions? For more check out the book wiki and let me know at &lt;a href="mailto:gary@laptoppress.com"&gt;gary@laptoppress.com&lt;/a&gt; what you think.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;p style="FONT-FAMILY: trebuchet ms"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-8308136478273602830?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/8308136478273602830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=8308136478273602830' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/8308136478273602830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/8308136478273602830'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2007/06/why-we-learn-oop.html' title='Why we learn OOP'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_8QiNaemP78E/RoGk6Vn3tfI/AAAAAAAAAEY/-2LWrJSpYPE/s72-c/DSC_0133.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-6438087618294588648</id><published>2007-06-19T11:17:00.000-07:00</published><updated>2007-06-19T11:20:01.240-07:00</updated><title type='text'>Summer Vacation</title><content type='html'>&lt;a href="http://bp1.blogger.com/_8QiNaemP78E/RngeSqOdDsI/AAAAAAAAAEQ/Iio22alolb8/s1600-h/IMG_2136.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5077841885781626562" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp1.blogger.com/_8QiNaemP78E/RngeSqOdDsI/AAAAAAAAAEQ/Iio22alolb8/s320/IMG_2136.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I have not posted for some time to this blog but I promise to get started again soon. My plans are to publish the book from which this blog derives very soon on Amazon using Mobipocket. Stay tuned....&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-6438087618294588648?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/6438087618294588648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=6438087618294588648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/6438087618294588648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/6438087618294588648'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2007/06/summer-vacation.html' title='Summer Vacation'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_8QiNaemP78E/RngeSqOdDsI/AAAAAAAAAEQ/Iio22alolb8/s72-c/IMG_2136.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-117034134026904415</id><published>2007-02-01T07:43:00.001-07:00</published><updated>2008-07-15T09:27:32.587-07:00</updated><title type='text'>Back in Business</title><content type='html'>This blog was originally created while doing the final edits  on a textbook called Fundamentals of Programming Logic.  The book is now a wiki and in the next stage of development.  It is free and you can read and comment on the entire book.  The project is still active and I plan on creating end of chapter materials that will validate the readers knowledge of the material.  Take a look for yourself:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://fundproglogic.pbwiki.com/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-117034134026904415?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/117034134026904415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=117034134026904415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/117034134026904415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/117034134026904415'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2007/02/back-in-business.html' title='Back in Business'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-114798658799737004</id><published>2006-05-18T14:09:00.000-07:00</published><updated>2007-02-14T05:47:48.570-07:00</updated><title type='text'>Divide and Conquer .... it!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3407/2158/1600/IMG_2158.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3407/2158/200/IMG_2158.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;A smart person once said the best strategy to solve difficult programs was to "divide and conquer."   It has been used by many over time to take complex problems and break them down into smaller pieces.  The idea being that the smaller pieces would be much easier to solve then trying to solve the entire problem. If you think of the complexity involved with something like the space shuttle, It would been impossible to develop if it were not possible to develop each one of the sub systems independent of one another (i.e. the take off systems are different than the landing systems are different than the communication systems).&lt;br /&gt;&lt;br /&gt;Programs are no different.  When we sit down and plan out our logic we need to think about ways the logic can be bundled into subsets of logic call modules.  We take these logic modules and implement them into programming statements.  For most programming languages these are called methods or functions (the basis of procedural programming). This makes the program easier to develop and also has the added benefit of making solutions that are more reusable and solutions that can be divided up among multiple programmers (i.e. each could work on a module that is part of the entire program).&lt;br /&gt;&lt;br /&gt;As in past blog entries, I have a .pdf file to link to that gives a more complete explaination of why modules are important and how to use them.  &lt;a href="http://www.laptoppress.com/blog/chp6-modules.pdf"&gt;&lt;span style="color: rgb(0, 64, 64);"&gt;&lt;b&gt;Click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to view the .pdf file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Last one to add a comment with an example of a module is a rotten egg...... am I being a little too forward in getting you involved with this blog.... GOOD:)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;The linked materials represent a small section of what is found in the book, "&lt;b&gt;The Fundamentals of Computer Programming&lt;/b&gt;" by Gary Marrer. The full book will be available on www.laptoppress.com. The book is still under development but you can look at some of the completed chapters on this web site. You may read, print or play .pdf and .mp3 files in this blog but the work is the property of the author and can not be resold or combined in any form. &lt;span style="font-weight: bold;"&gt;Photo credits: Gary Marrer.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-114798658799737004?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/114798658799737004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=114798658799737004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/114798658799737004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/114798658799737004'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/05/divide-and-conquer-it.html' title='Divide and Conquer .... it!'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-114066543445541320</id><published>2006-02-22T20:30:00.000-07:00</published><updated>2006-05-10T07:46:46.243-07:00</updated><title type='text'>Programming Errors.... not me!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3407/2158/1600/IMG_2391.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3407/2158/320/IMG_2391.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;We all make errors (I did once).  I once told some programmers working for me that errors were unavoidable.  You can not work in a dynamic environment such as programming and expect to know everything.  Technology is constantly changing and you have to change to keep up.  This means you are going to make errors.  The trick is not to make the same error twice.&lt;br /&gt;&lt;br /&gt;Certain kinds of error occur across all programming languages,  Syntax, runtime and logic errors occur in all programming languages on all platforms. They occur for new programmers and old programmers. As always, I have some material on  programming errors in this post. &lt;a href="http://www.laptoppress.com/blog/chp3-programmingErrors.pdf"&gt;&lt;span style="color: rgb(0, 64, 64);"&gt;&lt;b&gt;Click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to view the .pdf file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Have you run into one of these three types of programming errors? be honest.  Do you have a favorite story about a programming error?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;The linked materials represent a small section of what is found in the book, "&lt;b&gt;The Fundamentals of Computer Programming&lt;/b&gt;" by Gary Marrer. The full book will be available on www.laptoppress.com. The book is still under development but you can look at some of the completed chapters on this web site. You may read, print or play .pdf and .mp3 files in this blog but the work is the property of the author and can not be resold or combined in any form. &lt;span style="font-weight: bold;"&gt;Photo credits: Gary Marrer.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-114066543445541320?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/114066543445541320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=114066543445541320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/114066543445541320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/114066543445541320'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/02/programming-errors-not-me.html' title='Programming Errors.... not me!'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-113994440731407992</id><published>2006-02-14T12:00:00.000-07:00</published><updated>2006-02-22T20:23:24.296-07:00</updated><title type='text'>Sound Check!  - Any Audio Learners Out There....</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3407/2158/1600/yosemite.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3407/2158/320/yosemite.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;I have been including some mp3 files on this blog that are providing a spoken version of my textbook material. I am wondering what everyone thinks. I am using a Yeosoft product to convert text to an mp3 audio file with voices available for free from Microsoft.&lt;br /&gt;&lt;br /&gt;I am thinking of buying better voices from AT&amp;amp;T but I am wondering if it would make a difference. I have gotten some feedback on the voices and it was not good. Does it make a difference if the voice is not as computer generated? Would even a been voice package, which is still computer generated, be better or is the spoken word the only way to go?&lt;br /&gt;&lt;br /&gt;Any thoughts.....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-113994440731407992?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/113994440731407992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=113994440731407992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113994440731407992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113994440731407992'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/02/sound-check-any-audio-learners-out.html' title='Sound Check!  - Any Audio Learners Out There....'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-113932159757537647</id><published>2006-02-07T07:13:00.000-07:00</published><updated>2006-02-07T14:27:26.506-07:00</updated><title type='text'>Some cement, glue and bubble gum to connect those building blocks</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3407/2158/1600/yosemite7.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3407/2158/320/yosemite7.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The identifiers are the building blocks but they have to be connected to each other. Identifiers are linked together in expression with operators. Think of a simple calculation. If you have two variables that hold values that need to be accumulated. We add a addition operator and a equals sign and send of calculated total off to a third variable to hold our calculation. Aside from arithmetic operators there are also logical operators which help create boolean expressions ( the logic we use to make decsions on).&lt;br /&gt;&lt;br /&gt;I have some material on operators and expressions in this post. &lt;a href="http://www.laptoppress.com/blog/chp3-expressionsoperators.pdf"&gt;&lt;span style="color: rgb(0, 64, 64);"&gt;&lt;b&gt;Click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to view the .pdf file or&lt;span style="color: rgb(51, 51, 153);"&gt; &lt;/span&gt;&lt;a href="http://www.laptoppress.com/blog/chp3-expressionsoperators.mp3"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 153);"&gt;click here&lt;/span&gt;&lt;/a&gt; to listen to (or save if you right click on the link) the mp3 file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Do you have any questions about how identifiers, expression and operators work to create logic steps?  If so, send a comment.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;The linked materials repersent a small section of what is found in the book, "The Fundamentals of Computer Programming" by Gary Marrer. The full book will be available on www.laptoppress.com. The book is still under development but you can look at some of the completed chapters on this web site. You may read, print or play .pdf and .mp3 files in this blog but the work is the property of the author and can not be resold or combined in any form. &lt;span style="font-weight: bold;"&gt;Photo credits: Gary Marrer.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-113932159757537647?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/113932159757537647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=113932159757537647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113932159757537647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113932159757537647'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/02/some-cement-glue-and-bubble-gum-to.html' title='Some cement, glue and bubble gum to connect those building blocks'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-113892222148291967</id><published>2006-02-02T16:17:00.000-07:00</published><updated>2006-02-07T07:07:05.476-07:00</updated><title type='text'>A Programmers Building Blocks</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3407/2158/1600/IMG_2175.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3407/2158/320/IMG_2175.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 128, 128);font-size:85%;" &gt;Like a carpenter uses nails to build with wood&lt;/span&gt;&lt;/b&gt; a programmer uses identifiers and operators to write programs. In this blog, I will address identifiers (also known as variables and constants) and some of the rules applied to identifers. We use identifiers to hold the data we display and manipulate in our programs. Programming keywords act as instructions on identifiers so that our programs have the flexibility to be used with different inputs. Read the linked documents to see how documents are used and some of rules that govern them.&lt;br /&gt;&lt;br /&gt;I have some material on identifiers in this post. &lt;a href="http://www.laptoppress.com/blog/chp3-identifiers.pdf"&gt;&lt;span style="color: rgb(0, 64, 64);"&gt;&lt;b&gt;click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to view the .pdf file or &lt;a href="http://www.laptoppress.com/blog/chp3-identifiers.mp3"&gt;&lt;span style="color: rgb(0, 64, 64);"&gt;&lt;b&gt;click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to listen to (or save if you right click on the link) the mp3 file. I also have a second set of resources that review common rules applied to identifiers. &lt;a href="http://www.laptoppress.com/blog/chp3-identifierRules.pdf"&gt;&lt;span style="color: rgb(0, 64, 64);"&gt;&lt;b&gt;click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to view the .pdf file or &lt;a href="http://www.laptoppress.com/blog/chp3-identifierRules.mp3"&gt;&lt;span style="color: rgb(0, 64, 64);"&gt;&lt;b&gt;click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to listen to (or save if you right click on the link) the mp3 file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Do you have any quesitons about how indentifiers work?  If so, send a comment.&lt;/b&gt;&lt;span style="color: rgb(128, 0, 64);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The linked materials repersent a small section  of what is found in the book, "The Fundamentals of Computer Programming" by Gary Marrer. The full book will be available on &lt;a href="http://www.laptoppress.com"&gt;&lt;b&gt;www.laptoppress.com&lt;/b&gt;&lt;/a&gt;. The book is  still under development but you can look at some of the completed chapters on this web site.  You may read, print or play .pdf and .mp3 files in this blog but the work is the property of the author and can not be resold or combined in any form. &lt;span style="font-weight: bold;"&gt;Photo credits: Gary Marrer.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-113892222148291967?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/113892222148291967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=113892222148291967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113892222148291967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113892222148291967'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/02/programmers-building-blocks.html' title='A Programmers Building Blocks'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-113823046190138152</id><published>2006-01-25T16:04:00.000-07:00</published><updated>2006-02-07T07:07:22.650-07:00</updated><title type='text'>Planning for your Program - Continued...</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3407/2158/1600/cabin.jpg"&gt;&lt;img style="margin: 0px 0px 10px 10px; float: right;" alt="" src="http://photos1.blogger.com/blogger/3407/2158/320/cabin.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 128, 128);font-size:85%;" &gt;As the previous blog discussed&lt;/span&gt;&lt;/b&gt;, planning is critical to creating a high quality solution that provides a solution for the problem that it was intended to solve. We sometimes call this programs models. They are models because they are an abstraction of reality. Sounds like rocket science but what it really means is that these plans are only concepts. Once we get in there and actually create the program source code, we may find our models need to be changed to become workable solutions.&lt;br /&gt;&lt;br /&gt;I have some material on psuedo code in this post. &lt;a href="http://www.laptoppress.com/blog/chp2-pseudocode.pdf"&gt;&lt;span style="color: rgb(0, 64, 128);"&gt;&lt;b&gt;click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to view the .pdf file or &lt;a href="http://www.laptoppress.com/chp2-pseudocode.mp3"&gt;&lt;span style="color: rgb(0, 64, 64);"&gt;&lt;b&gt;click here&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; to listen to (or save if you right click on the link) the mp3 file.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The linked materials repersent a small section  of what is found in the book, "The Fundamentals of Computer Programming" by Gary Marrer. The full book will be available on &lt;a href="http://www.laptoppress.com/"&gt;&lt;b&gt;www.laptoppress.com&lt;/b&gt;&lt;/a&gt;. The book is  still under development but you can look at some of the completed chapters on this web site.  You may read, print or play .pdf and .mp3 files in this blog but the work is the property of the author and can not be resold or combined in any form. &lt;span style="font-weight: bold;"&gt;Photo credits: Gary Marrer.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-113823046190138152?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/113823046190138152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=113823046190138152' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113823046190138152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113823046190138152'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/01/planning-for-your-program-continued.html' title='Planning for your Program - Continued...'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-113822872611895847</id><published>2006-01-25T15:38:00.000-07:00</published><updated>2006-02-07T07:07:40.320-07:00</updated><title type='text'>Planning for your program....</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3407/2158/1600/IMG_2277.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3407/2158/320/IMG_2277.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 64, 128);font-size:100%;" &gt;Like most things of consequence&lt;/span&gt;&lt;/b&gt;, you do not want to start them without a plan. Writing programs is no different. We need to sit down with the programs users and understand what we need to build. Once we have asked the appropriate questions, we can come up with a blueprint or roadmap to follow. I have linked to this blog a summary of the planning process and how we can use flowcharts to display our plan. A picture is worth a thousand words they say and this is one of the strenghts of flowcharts. In my next blog post, I will review another methods of building a plan for our programming. This alternative approach is called pseudo code and this is also a very powerful planning tool.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(128, 0, 64);font-size:85%;" &gt;Maybe we could get a few blog readers to to comment on which approach they like best...... Are you a flowcharter, a pseudo code writer or both?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;b&gt;To Read my Program Planning Fundamentals Text&lt;/b&gt;&lt;/span&gt;&lt;a href="http://www.laptoppress.com/blog/chp2-flowcharts.pdf"&gt; &lt;span style="color: rgb(128, 0, 64);"&gt;click here&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;br /&gt;&lt;b&gt;You can also listen to this chapter as an mp3 file. &lt;/b&gt; &lt;/span&gt;&lt;a href="http://www.laptoppress.com/blog/chp2-flowcharts.mp3"&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;click here &lt;/span&gt;&lt;/a&gt;to access the Programming Planning .mp3 file&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The linked materials repersent a small section  of what is found in the book, "The Fundamentals of Computer Programming" by Gary Marrer. The full book will be available on &lt;a href="http://www.laptoppress.com/"&gt;&lt;b&gt;www.laptoppress.com&lt;/b&gt;&lt;/a&gt;. The book is  still under development but you can look at some of the completed chapters on this web site.  You may read, print or play .pdf and .mp3 files in this blog but the work is the property of the author and can not be resold or combined in any form. &lt;span style="font-weight: bold;"&gt;Photo credits: Gary Marrer.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-113822872611895847?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/113822872611895847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=113822872611895847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113822872611895847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113822872611895847'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/01/planning-for-your-program.html' title='Planning for your program....'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-113822653971786436</id><published>2006-01-25T15:02:00.000-07:00</published><updated>2006-02-07T07:07:57.536-07:00</updated><title type='text'>Getting Started</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3407/2158/1600/IMG_1417.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3407/2158/320/IMG_1417.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 64, 128);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;It's time to get started.&lt;/span&gt; &lt;/span&gt; Learning to become a programmer requires that you first understand a little about what programmers do and how they do it. Part of how they do is to follow a process. A process is a set of tasks. A good process is one that has been tested ...stood the test of time... and is followed the same way each time it is done. The process of writing programs is important because it has been proven to work and because other programmers follow a similar process. Like other professionals, professional programmers all follow essentially the same process and professional standards. I have a attached a link to a chapter from Fundamentals of Programming textbook that discusess a programming process and how it would be used to develop a computer application.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;b&gt;To Read my Introduction to Programming &lt;/b&gt;&lt;/span&gt;&lt;a href="http://www.laptoppress.com/blog/chp1.pdf"&gt; &lt;span style="color: rgb(128, 0, 64);"&gt;click here&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;&lt;br /&gt;&lt;b&gt;You can also listen to this chapter as an mp3 file. &lt;/b&gt; &lt;/span&gt;&lt;a href="http://www.laptoppress.com/blog/chp1.mp3"&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;click here &lt;/span&gt;&lt;/a&gt;to access the Introduction to Programming .mp3 file&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The linked materials repersent a small section  of what is found in the book, "The Fundamentals of Computer Programming" by Gary Marrer. The full book will be available on &lt;a href="http://www.laptoppress.com/"&gt;&lt;b&gt;www.laptoppress.com&lt;/b&gt;&lt;/a&gt;. The book is  still under development but you can look at some of the completed chapters on this web site.  You may read, print or play .pdf and .mp3 files in this blog but the work is the property of the author and can not be resold or combined in any form. &lt;span style="font-weight: bold;"&gt;Photo credits: Gary Marrer.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-113822653971786436?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/113822653971786436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=113822653971786436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113822653971786436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113822653971786436'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/01/getting-started_113822653971786436.html' title='Getting Started'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21348259.post-113795253037440346</id><published>2006-01-22T10:47:00.000-07:00</published><updated>2006-06-27T10:01:48.923-07:00</updated><title type='text'>Hello programmers....</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3407/2158/1600/IMG_1711.jpg"&gt;&lt;img style="margin: 0px 0px 10px 10px; float: right;" alt="" src="http://photos1.blogger.com/blogger/3407/2158/200/IMG_1711.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 102, 0);"&gt;Welcome to my programming blog&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;.&lt;/span&gt; I have taught various programming languages at the community college and university level in both tradional and online formats over the last 8 years. I have also written the first draft of a programming textbook for new programmers.&lt;br /&gt;&lt;br /&gt;From this blog, I will share some of the lecture and textbook materal to those of you interested in programming. You will also see some podcasts made available for those of you who like to listen to your lectures and books.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Photo credit: Gary Marrer&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21348259-113795253037440346?l=sagestage.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagestage.blogspot.com/feeds/113795253037440346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21348259&amp;postID=113795253037440346' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113795253037440346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21348259/posts/default/113795253037440346'/><link rel='alternate' type='text/html' href='http://sagestage.blogspot.com/2006/01/hello-programmers.html' title='Hello programmers....'/><author><name>Gary</name><uri>http://www.blogger.com/profile/14747034353323782894</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://4.bp.blogspot.com/_8QiNaemP78E/SOQI6BX1cEI/AAAAAAAAAjs/Iuq3-Xr49jI/S220/garymSmallPic.png'/></author><thr:total>1</thr:total></entry></feed>
