<?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-7054004109324125889</id><updated>2011-11-27T16:27:38.061-08:00</updated><category term='Chapter 1'/><category term='Chapter 2'/><title type='text'>Beginners Programming</title><subtitle type='html'>READ ARTICLES AND LEARN HOW TO CREATE A COMPUTER PROGRAM. A PROGRAMMING FOR BEGINNERS GUIDE. CODE IT EASY WITH BEGINNERS PROGRAMMING.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7054004109324125889.post-5543927524752002567</id><published>2007-12-07T09:13:00.000-08:00</published><updated>2007-12-07T09:53:59.980-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chapter 2'/><title type='text'>Chapter 2, Lesson 1</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;Welcome to Beginners Programming&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R1mAgVrC2xI/AAAAAAAAAG0/KSxjJl3Uo8Q/s1600-h/image004.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 83px; height: 87px;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R1mAgVrC2xI/AAAAAAAAAG0/KSxjJl3Uo8Q/s400/image004.gif" alt="" id="BLOGGER_PHOTO_ID_5141281742681987858" border="0" /&gt;&lt;/a&gt;Have you ever ridden on a roller coaster with a loop? Sounds fun isn’t it? But I have not rode a roller coaster with a loop. So what’s with the loop? You may ask, well it is our lesson for this chapter. Chapter 2 : Looping. Yep, were on chapter 2.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Looping&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R1mBOVrC2zI/AAAAAAAAAHE/osGI_Z-2qn8/s1600-h/image006.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R1mBOVrC2zI/AAAAAAAAAHE/osGI_Z-2qn8/s400/image006.jpg" alt="" id="BLOGGER_PHOTO_ID_5141282532955970354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R1mBu1rC21I/AAAAAAAAAHU/mp_0EriWKIg/s1600-h/image010.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R1mBu1rC21I/AAAAAAAAAHU/mp_0EriWKIg/s400/image010.gif" alt="" id="BLOGGER_PHOTO_ID_5141283091301718866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;So what is looping? It is basically repeating a process over and over again. It is like having ten sit-ups a day.  So everyday you have to repeat the process, 10 sit-ups.  We also have the infinite loop, where we process the data without end, but we don’t want to apply it to sit-ups.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;We sometimes refer to the infinite loop as “hang”. We commonly hear our friends say “My Computer Hanged” or “My Computer Froze”, other call it “Bug”, sometimes it is caused by a Virus (which repeats a process over and over, then chokes the memory of the computer).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Okay, let’s say you want to print your name 3 times on the screen, without the loop, it can be done.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Flowchart 1:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R1mC3VrC26I/AAAAAAAAAH8/m99mwxFqCLQ/s1600-h/image012.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R1mC3VrC26I/AAAAAAAAAH8/m99mwxFqCLQ/s400/image012.gif" alt="" id="BLOGGER_PHOTO_ID_5141284336842234786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;And we have a flowchart that prints 3 “John”. How about printing it 100 times? Yes, your flowchart will be looooooooong, just to print the name “John”. This is where the loop comes in.  We can repeat the name 100 times using loop, so our flowchart will be just a short one. I’ll give you two exactly the same example but different logic.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s1600-h/image015.gif"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s1600-h/image015.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s400/image015.gif" alt="" id="BLOGGER_PHOTO_ID_5141284444216417202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Logic 1&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R1mCPFrC23I/AAAAAAAAAHk/9Bay7lpGrFc/s1600-h/image013.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R1mCPFrC23I/AAAAAAAAAHk/9Bay7lpGrFc/s400/image013.gif" alt="" id="BLOGGER_PHOTO_ID_5141283645352500082" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In Logic 1, we have minimized the flowchart by using a loop,  if there is a certain portion of our code block that is to be repeated a number of times.&lt;br /&gt;&lt;br /&gt;Algorithm:&lt;br /&gt;1. start&lt;br /&gt;2. Initialize the variable i = 1&lt;br /&gt;3. we ask if the value of i is less than or equal to 100, else go to number 7.&lt;br /&gt;4. we print “John”&lt;br /&gt;5. we add 1 to the variable i = i + 1 (value of i is 1, hence = 1 + 1, the value of i now is 2, hence = 2 + 1, etc….)&lt;br /&gt;6. repeat number 3.&lt;br /&gt;7. end of the program&lt;br /&gt;&lt;br /&gt;We can also draw the flowchart this way:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s1600-h/image015.gif"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s1600-h/image015.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s400/image015.gif" alt="" id="BLOGGER_PHOTO_ID_5141284444216417202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Logic 2&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R1mCU1rC24I/AAAAAAAAAHs/3SVlUR3cj24/s1600-h/image014.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R1mCU1rC24I/AAAAAAAAAHs/3SVlUR3cj24/s400/image014.gif" alt="" id="BLOGGER_PHOTO_ID_5141283744136747906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s1600-h/image015.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s400/image015.gif" alt="" id="BLOGGER_PHOTO_ID_5141284444216417202" border="0" /&gt;&lt;/a&gt;Logic 1, we ask first before we print the name&lt;br /&gt;Logic 2, we print the name before we ask&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Either way we still get the same result. So when making a flowchart, the path to take or the flow will all depend on your logic on how you solve a particular problem.&lt;br /&gt;&lt;br /&gt;You can also control the looping, and it will be your decision as to when the program will end.  Yes, you wish is the computer’s command.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s1600-h/image015.gif"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s1600-h/image015.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R1mC9lrC27I/AAAAAAAAAIE/JOqVNlWDhFs/s400/image015.gif" alt="" id="BLOGGER_PHOTO_ID_5141284444216417202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Same as Logic 2, but with interaction with user.&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R1mDg1rC28I/AAAAAAAAAIM/myfuX7e6ZJU/s1600-h/image016.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R1mDg1rC28I/AAAAAAAAAIM/myfuX7e6ZJU/s400/image016.gif" alt="" id="BLOGGER_PHOTO_ID_5141285049806805954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Algorithm:&lt;br /&gt;&lt;br /&gt;1. start&lt;br /&gt;2. We initialized the value of Reply  to space or blank&lt;br /&gt;3. we print “John”&lt;br /&gt;4. we ask if the user wants to print it again, user will enter either  Y or N&lt;br /&gt;5. get the user input&lt;br /&gt;6. test if the input is Y or N, if Y, we repeat process number 3, else we go to number 7.&lt;br /&gt;7. end of the program.&lt;br /&gt;&lt;br /&gt;And there you have it. The flow terminates only when the user inputs ‘N’ and is assigned the variable Reply.&lt;br /&gt;&lt;br /&gt;We can apply the logic to chapter 1, lesson 4, problem 5.&lt;br /&gt;&lt;br /&gt;Original flowchart&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R1mErFrC29I/AAAAAAAAAIU/QLmVu8Kt_1I/s1600-h/image020.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R1mErFrC29I/AAAAAAAAAIU/QLmVu8Kt_1I/s400/image020.jpg" alt="" id="BLOGGER_PHOTO_ID_5141286325412092882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Modified flowchart:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R1mIkFrC2_I/AAAAAAAAAIk/G5mJAsuLddc/s1600-h/image017.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R1mIkFrC2_I/AAAAAAAAAIk/G5mJAsuLddc/s400/image017.gif" alt="" id="BLOGGER_PHOTO_ID_5141290603199519730" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The original flowchart has 3 known Quiz results, compute and print for the average grade and stop, but the modified flowchart (as you noticed, I grouped similar items to one symbol), the 3 quizzes are unknown, so we let the user to input the values for the quizzes, then compute and print the average grade. The user now can repeat the process over and over, and exit or terminate the program when needed.&lt;br /&gt;&lt;br /&gt;- End of Chapter 2, Lesson 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7054004109324125889-5543927524752002567?l=beginners-programming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/5543927524752002567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7054004109324125889&amp;postID=5543927524752002567' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/5543927524752002567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/5543927524752002567'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/2007/12/welcome-to-beginners-programming.html' title='Chapter 2, Lesson 1'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_xO73aeIheW8/R1mAgVrC2xI/AAAAAAAAAG0/KSxjJl3Uo8Q/s72-c/image004.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7054004109324125889.post-8898280911392235610</id><published>2007-11-27T09:13:00.001-08:00</published><updated>2007-12-07T10:59:38.564-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chapter 1'/><title type='text'>Chapter 1, Lesson 6</title><content type='html'>Welcome to Beginners Programming.&lt;br /&gt;&lt;br /&gt;However you think about it, our life is like a program, we have a pattern in which we should follow each and everyday.   Some path that we should take whenever we face life’s choices, but then again, we still follow the program whichever path we take.  No, its not the same pattern but it resembles what was.  Let me show you a flowchart, just to let you see what I am trying to imply.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R0xQaUl3u5I/AAAAAAAAAEk/c2d365BkUts/s1600-h/image002.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R0xQaUl3u5I/AAAAAAAAAEk/c2d365BkUts/s400/image002.gif" alt="" id="BLOGGER_PHOTO_ID_5137569688057265042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see, you are trapped in a pattern which you cannot deny. Isn’t that what you are doing? Or if you are a student, you would follow this flow:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R0xQj0l3u6I/AAAAAAAAAEs/csvc_oDiUwU/s1600-h/image003.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R0xQj0l3u6I/AAAAAAAAAEs/csvc_oDiUwU/s400/image003.gif" alt="" id="BLOGGER_PHOTO_ID_5137569851266022306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But it looks the same, the flow is the same. Oh you’ve noticed eh? The routine is different but the pattern is the same. Think about it, we are all locked into a flow, whatever pattern it may be, but it goes around and around everyday.  Take this example:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R0xQrkl3u7I/AAAAAAAAAE0/3Ck1XmdfxKE/s1600-h/image005.gif"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R0xQrkl3u7I/AAAAAAAAAE0/3Ck1XmdfxKE/s400/image005.gif" alt="" id="BLOGGER_PHOTO_ID_5137569984410008498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Can we change it? Maybe. Can we escape the routine? Hmm we could, but it will still be another routine. Can we break the routine?  I don’t know. Ask the experts about this. Now I’m pulling you back to our pattern, the problem solving and flowchart making.&lt;br /&gt;&lt;br /&gt;Our lesson is to create a complex flowchart, but of course we need a problem so it will be more specific.&lt;br /&gt;&lt;br /&gt;Problem 1:&lt;br /&gt;Input 3 numbers and draw a flowchart that would determine which number is greater, and display the number on the screen.&lt;br /&gt;&lt;br /&gt;Variables needed:&lt;br /&gt;1. A, B, C&lt;br /&gt;&lt;br /&gt;What does the problem want?&lt;br /&gt;1. Determine the larger value&lt;br /&gt;2. Display the larger value on the screen.&lt;br /&gt;&lt;br /&gt;Flowchart&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R0xQ70l3u8I/AAAAAAAAAE8/FQziOno1dPg/s1600-h/image008.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R0xQ70l3u8I/AAAAAAAAAE8/FQziOno1dPg/s400/image008.gif" alt="" id="BLOGGER_PHOTO_ID_5137570263582882754" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Yep, its like building a house.  Can you follow the flow? Let us trace the flowchart.&lt;br /&gt;&lt;br /&gt;Possible 1:&lt;br /&gt;&lt;br /&gt;A=8, B=5 and C=3&lt;br /&gt;&lt;br /&gt;1. it first get data from keyboard&lt;br /&gt;2. then it asks if A &gt; B (8 &gt; 5)&lt;br /&gt;3. true, it asks if A &gt; C (8 &gt; 3)&lt;br /&gt;4. true, it prints the value of A (8) on the screen&lt;br /&gt;&lt;br /&gt;Possible 2:&lt;br /&gt;&lt;br /&gt;A=5, B=10 and C=3&lt;br /&gt;&lt;br /&gt;1. it first get data from keyboard&lt;br /&gt;2. then it asks if A &gt; B (5 &gt; 10)&lt;br /&gt;3. false, it asks if B &gt; C (10 &gt; 3)&lt;br /&gt;4. true, it prints the value of B (10) on the screen&lt;br /&gt;&lt;br /&gt;Possible 3:&lt;br /&gt;&lt;br /&gt;A=8, B=5 and C=18&lt;br /&gt;&lt;br /&gt;1. it first get data from keyboard&lt;br /&gt;2. then it asks if A &gt; B (8 &gt; 5)&lt;br /&gt;3. true, it asks if A &gt; C (8 &gt; 18)&lt;br /&gt;4. false, it asks if B &gt; C (5 &gt; 18)&lt;br /&gt;5. false, it prints the value of C (18) on the screen&lt;br /&gt;&lt;br /&gt;Possible 4:&lt;br /&gt;&lt;br /&gt;A=5, B=10 and C=11&lt;br /&gt;&lt;br /&gt;1. it first get data from keyboard&lt;br /&gt;2. then it asks if A &gt; B (5 &gt; 10)&lt;br /&gt;3. false, it asks if B &gt; C (10 &gt; 11)&lt;br /&gt;4. false, it prints the value of C (11) on the screen&lt;br /&gt;&lt;br /&gt;So that’s about it. We have seen how our flow of logic makes it through each possibility. But what if they have the same value? Yes what about it? Then we create a new flowchart to satisfy the need.&lt;br /&gt;&lt;br /&gt;Revised Flowchart&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R0xRGUl3u9I/AAAAAAAAAFE/lcxpI0qsY84/s1600-h/image009.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R0xRGUl3u9I/AAAAAAAAAFE/lcxpI0qsY84/s400/image009.gif" alt="" id="BLOGGER_PHOTO_ID_5137570443971509202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Take note of the red colors, that’s the changes I made to satisfy the problem when one or more inputs are equal.&lt;br /&gt;&lt;br /&gt;What can you get out of making a flowchart?&lt;br /&gt;&lt;br /&gt;1. Communicate: Flowcharts are better way of communicating the logic of a system.&lt;br /&gt;2. Analyze Effectively: Problem can be analyzed in more effective way by following the flow.&lt;br /&gt;3. Good documentation: Flowcharts serve as a good program documentation, which is needed for various purposes.&lt;br /&gt;4. Easy coding: The flowcharts act as a guide or blueprint during the systems analysis and program development phase.&lt;br /&gt;5. Problem Identification: The flowchart helps in identifying the problem as it progress.&lt;br /&gt;6. Easy Maintenance: The maintenance of operating program becomes easy with the help of flowchart. It helps the programmer to put efforts more efficiently on that part&lt;br /&gt;&lt;br /&gt;What the limitations of using the flowchart?&lt;br /&gt;&lt;br /&gt;1. Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart becomes complex and clumsy.&lt;br /&gt;2. Alterations and Modifications: If alterations are required the flowchart may require re-drawing completely.&lt;br /&gt;&lt;br /&gt;I guess that’s it for now.  See you in our next lesson.&lt;br /&gt;&lt;br /&gt;-End of lesson 6 Beginners Programming&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7054004109324125889-8898280911392235610?l=beginners-programming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/8898280911392235610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7054004109324125889&amp;postID=8898280911392235610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/8898280911392235610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/8898280911392235610'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/2007/11/welcome-to-beginners-programming_27.html' title='Chapter 1, Lesson 6'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_xO73aeIheW8/R0xQaUl3u5I/AAAAAAAAAEk/c2d365BkUts/s72-c/image002.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7054004109324125889.post-4775909824047471839</id><published>2007-11-26T06:32:00.000-08:00</published><updated>2007-12-07T10:59:12.782-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chapter 1'/><title type='text'>Chapter 1, Lesson 5</title><content type='html'>Welcome to Beginners Programming.    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;Did you answer the problem I left you at lesson 4? &lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;Lesson 4, Problem 3&lt;br /&gt;Draw a flowchart that would input the name, age and gender of a person, print “Hello” if age is less than or equal to 59, else “Hi”, and print also the name.&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;Flowchart:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;div style="text-align: left;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R0rZSUl3u1I/AAAAAAAAAEE/iwTemrvP2_s/s1600-h/image001.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R0rZSUl3u1I/AAAAAAAAAEE/iwTemrvP2_s/s400/image001.gif" alt="" id="BLOGGER_PHOTO_ID_5137157233757895506" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;v:shape id="_x0000_i1027" type="#_x0000_t75" style=""&gt;  &lt;v:imagedata croptop="-65520f" cropbottom="65520f"&gt; &lt;/v:imagedata&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Our lesson now is to analyze the word problem.&lt;span style=""&gt;  &lt;/span&gt;Firstly, we must determine what the problem wants, what the given values are, what are we looking for, what is the formula (for computations if any), and what it want to display. Let’s try an example problem.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Problem 1:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Given the radius of 8.4, compute for the area of the circle, and print out the radius and the area of the circle on the screen.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-left: 21pt; text-indent: -0.25in;"&gt;What does the problem want?&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 21pt; text-indent: -0.25in;"&gt;1. compute for the area of the circle&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 21pt; text-indent: -0.25in;"&gt;2. display the radius and area to the screen&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;What is given?&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;1. &lt;/span&gt;&lt;/span&gt;radius=8.4&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;2. &lt;/span&gt;&lt;/span&gt;PI = 3.1416 (constant)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How to we compute for the area of the circle?&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;Formula: PI * radius&lt;sup&gt;2&lt;/sup&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;PI = 3.1416&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;What are the variables needed?&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;1. &lt;/span&gt;&lt;/span&gt;PI&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;2. radius&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;3. area&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now with this information what we have, we can now draw a flowchart out of it.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;div style="text-align: left;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;w:wrap type="none"&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R0rZpUl3u2I/AAAAAAAAAEM/rKXh8s9-W4c/s1600-h/image003.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R0rZpUl3u2I/AAAAAAAAAEM/rKXh8s9-W4c/s400/image003.gif" alt="" id="BLOGGER_PHOTO_ID_5137157628894886754" border="0" /&gt;&lt;/a&gt;&lt;/w:wrap&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" style=""&gt;  &lt;v:imagedata croptop="-65520f" cropbottom="65520f"&gt; &lt;/v:imagedata&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/v:shape&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;And there you have it. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Problem 2:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Draw a flowchart that would input three (3) numbers, compute for the sum, average and product. Display the sum, average and product on the screen.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What does the problem want?&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;1. Compute      for the sum of the 3 numbers&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;2. Compute      for the average of the 3 numbers&lt;/p&gt;&lt;p class="MsoNormal"&gt;3. Compute      for the product of the 3 numbers&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;4. Display      the sum, average and product on the screen.&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What is given?&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;1. None&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Where do we get the values of the three numbers?&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;1. By      input (from the user)&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are the formulas needed&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;1. sum =      x1 + x2 + x3&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;2. average      = sum / 3&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;3. product      = x1 * x2 * x3&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What are the variables needed?&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;1. Sum&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;2. Average&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;3. Product&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;4. N1, N2,      N3 (for the 3 numbers)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now we are ready to draw a flowchart. (You can use a pencil and paper)&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R0rZwEl3u3I/AAAAAAAAAEU/vHd9U0sQbTc/s1600-h/image005.gif"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R0rZwEl3u3I/AAAAAAAAAEU/vHd9U0sQbTc/s400/image005.gif" alt="" id="BLOGGER_PHOTO_ID_5137157744859003762" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;v:line id="_x0000_s1054" style="" from="2079,13426" to="2080,13712" coord=""&gt;&lt;v:line id="_x0000_s1055" style="" from="2079,12780" to="2086,13036" coord=""&gt;&lt;w:wrap type="none"&gt;And Walla! Another flowchart made.&lt;span style=""&gt;  &lt;/span&gt;&lt;/w:wrap&gt;&lt;/v:line&gt;&lt;/v:line&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;v:shape id="_x0000_i1026" type="#_x0000_t75" style=""&gt;  &lt;v:imagedata croptop="-65520f" cropbottom="65520f"&gt; &lt;/v:imagedata&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/v:shape&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Are we feeling the flow now? I hope you do, because it will be your ammunition to creating an actual computer program, well at least it will be your basis and guide, an overview as to how your program will flow. We will try a flowchart with a decision.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Problem 3:&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The XYZ Manufacturing Inc., is giving each employee a year end bonus. If the employee salary is &lt;&gt;= 1000, the bonus is 1000. Draw a flowchart that would compute for the employee’s bonus and display the employee total salary.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R0rZ40l3u4I/AAAAAAAAAEc/AI9lf7rgLLY/s1600-h/image008.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R0rZ40l3u4I/AAAAAAAAAEc/AI9lf7rgLLY/s400/image008.gif" alt="" id="BLOGGER_PHOTO_ID_5137157895182859138" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;By this time I assume that you already understood how to understand the word problem, define the variables to be used, and the flowchart making techniques. &lt;span style=""&gt; &lt;/span&gt;I am trying my best to make it as easy as possible for you. And if you do have questions and or comments, it is very much welcome. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Next lesson would be a more complex flowchart.&lt;/p&gt;&lt;p class="MsoNormal"&gt;-End of lesson 5 Beginners Programming&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7054004109324125889-4775909824047471839?l=beginners-programming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/4775909824047471839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7054004109324125889&amp;postID=4775909824047471839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/4775909824047471839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/4775909824047471839'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/2007/11/welcome-to-beginners-programming_26.html' title='Chapter 1, Lesson 5'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xO73aeIheW8/R0rZSUl3u1I/AAAAAAAAAEE/iwTemrvP2_s/s72-c/image001.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7054004109324125889.post-1028174015015783362</id><published>2007-11-25T06:07:00.000-08:00</published><updated>2007-12-07T10:58:46.873-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chapter 1'/><title type='text'>Chapter 1, Lesson 4</title><content type='html'>Welcome to Beginners Programming&lt;br /&gt;&lt;br /&gt;Before we go on, let’s take a little peep at variables. What are variables? A variable is a term given to a thing, or a certain value, that may change. In mathematics, a variable often represents an "unknown" quantity that has the potential to change, in computer science, it represents a place where a quantity can be stored.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;X = 100&lt;br /&gt;FirstName=”John Doe”&lt;br /&gt;Sum = 1+1&lt;br /&gt;Average = 300/5&lt;br /&gt;&lt;br /&gt;Quiz1=3, Quiz2 =5, Quiz3=5&lt;br /&gt;This_is_another_Average = (Quiz1+ Quiz2+ Quiz3)/3&lt;br /&gt;&lt;br /&gt;Variables can be any letter or number but it cannot start with a number. Numerous tutorials or info about variables can be found over the internet nowadays, but we will stick on the basics.&lt;br /&gt;&lt;br /&gt;The relational operator&lt;br /&gt;&lt;br /&gt;=        Equal to&lt;br /&gt;&gt;        Greater than&lt;br /&gt;&lt;&gt;=    Greater than or equal to&lt;br /&gt;&lt;=    Less than or equal to &lt;&gt;    Not equal to&lt;br /&gt;&lt;br /&gt;The mathematical operator&lt;br /&gt;+ addition&lt;br /&gt;- deduction&lt;br /&gt;* Multiplication&lt;br /&gt;/ Division&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Are you ready?&lt;br /&gt;&lt;br /&gt;Flowchart&lt;br /&gt;&lt;br /&gt;During my school days, we actually had 1 course for flowcharting; we did not get to use the computer until we finish the flowcharting course. It is somewhat frustrating not to be able to use the computer but hey, when the time came, computer programming is not a problem anymore. For beginners, flowchart is essential because you can see the flow of the program before making the actual code. For now we dig ourselves with flowcharts. I’m sure every programmer knows about this but hey, I’m assuming you are a beginner, so here we go.&lt;br /&gt;&lt;br /&gt;Firstly you have to memorize the basic flowchart symbols as seen in Figure 1 in Chapter 1, Lesson 1, so you will know what the symbol is for and can interpret what is going on with the flow of your program.&lt;br /&gt;&lt;br /&gt;Problem 1&lt;br /&gt;&lt;br /&gt;Draw a flowchart that would find the sum of the two numbers 5 and 7. Display the sum  &lt;p style="margin-bottom: 12pt;"&gt;Figure 1:&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R1gwlVrC2pI/AAAAAAAAAF0/VOsqXlldgts/s1600-h/image001.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R1gwlVrC2pI/AAAAAAAAAF0/VOsqXlldgts/s400/image001.gif" alt="" id="BLOGGER_PHOTO_ID_5140912392674400914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style="margin-bottom: 12pt;"&gt;Let’s try to put a variable, and apply some rules. Initialize all variables.&lt;/p&gt;  &lt;p style="margin-bottom: 12pt;"&gt;Figure 2:&lt;/p&gt;  &lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R1gwsVrC2qI/AAAAAAAAAF8/1cf0GItGmRY/s1600-h/image002.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R1gwsVrC2qI/AAAAAAAAAF8/1cf0GItGmRY/s400/image002.gif" alt="" id="BLOGGER_PHOTO_ID_5140912512933485218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;  &lt;p style="margin-bottom: 12pt;"&gt;As you can see, in figure 1, we just added the two numbers and placed the result in a variable called Sum, then we print it on the screen, however, in figure 2, we created 3 variables , X, Y and Sum.&lt;/p&gt; &lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R1gwyFrC2rI/AAAAAAAAAGE/_r9SuDTPnko/s1600-h/image003.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R1gwyFrC2rI/AAAAAAAAAGE/_r9SuDTPnko/s400/image003.gif" alt="" id="BLOGGER_PHOTO_ID_5140912611717733042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;  &lt;p style="margin-bottom: 12pt;"&gt;&lt;span style=""&gt; &lt;/span&gt;We let X=5 , Y=7 &lt;span style=""&gt; &lt;/span&gt;and Sum = 0. &lt;span style=""&gt; &lt;/span&gt;Then we compute for the sum.&lt;/p&gt;  &lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1gxP1rC2sI/AAAAAAAAAGM/EVvLxkL8vdg/s1600-h/image004.gif"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R1gxP1rC2sI/AAAAAAAAAGM/EVvLxkL8vdg/s400/image004.gif" alt="" id="BLOGGER_PHOTO_ID_5140913122818841282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;  &lt;p style="margin-bottom: 12pt;"&gt;Either way, we produce the same result, we printed out the Sum of the two numbers.&lt;span style=""&gt;  &lt;/span&gt;So now the question will be, what if X and Y is unknown , and we let the user / operator decide what number to be computed, then we have problem 2.&lt;/p&gt;  &lt;p style="margin-bottom: 12pt;"&gt;Problem 2:&lt;/p&gt;  &lt;p style="margin-bottom: 12pt;"&gt;Draw a flowchart that would input 3 numbers. &lt;span style=""&gt; &lt;/span&gt;Find the sum of the 3 numbers and print the sum.&lt;/p&gt;  &lt;p style="margin-bottom: 12pt;"&gt;Figure 3:&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R1gxkVrC2tI/AAAAAAAAAGU/IDFPUhSUeEU/s1600-h/image005.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R1gxkVrC2tI/AAAAAAAAAGU/IDFPUhSUeEU/s400/image005.gif" alt="" id="BLOGGER_PHOTO_ID_5140913475006159570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;  &lt;p style="margin-bottom: 12pt;"&gt;We have initialized 4 variables, the X, Y, Z and Sum. &lt;span style=""&gt; &lt;/span&gt;Then we ask the user to input or enter a number for X, Y and Z.&lt;/p&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1gxq1rC2uI/AAAAAAAAAGc/-ouvpqvtJ7E/s1600-h/image006.gif"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R1gxq1rC2uI/AAAAAAAAAGc/-ouvpqvtJ7E/s400/image006.gif" alt="" id="BLOGGER_PHOTO_ID_5140913586675309282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style="margin-bottom: 12pt;"&gt;And the rest is history. Let’s try getting the average of the 3 numbers.&lt;/p&gt;  &lt;p style="margin-bottom: 12pt;"&gt;Problem 4:&lt;/p&gt;  &lt;p style="margin-bottom: 12pt;"&gt;Draw a flowchart that would input 3 numbers. &lt;span style=""&gt; &lt;/span&gt;Find the sum of the 3 numbers, compute for the average and print the sum and the average.&lt;/p&gt;  &lt;p style="margin-bottom: 12pt;"&gt;Figure 4:&lt;/p&gt; &lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1g0b1rC2wI/AAAAAAAAAGs/AJfLKzsbxa8/s1600-h/image021.gif"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R1g0b1rC2wI/AAAAAAAAAGs/AJfLKzsbxa8/s400/image021.gif" alt="" id="BLOGGER_PHOTO_ID_5140916627512154882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style="margin-bottom: 12pt;"&gt;In the initialization phase, we added 1 variable called Average. , at the processing, we added the computation for average (Average = Sum / 3). Then we added a print symbol that prints the average.&lt;/p&gt;  &lt;p style="margin-bottom: 12pt;"&gt;There. Very easy isn’t it? Its easy to draw, its easy to read, and its easy to follow. Let’s try a problem which is closer to reality.&lt;/p&gt;&lt;p style="margin-bottom: 12pt;"&gt;“To be or not to be! “&lt;br /&gt;&lt;br /&gt;Decisions. We encounter decision making almost 95% of our activities in life, what we eat, drink, do, and etc. We will also apply decision making in flowchart. We will modify the first flowchart I created in Lesson 1.&lt;/p&gt;&lt;p style="margin-bottom: 12pt;"&gt;Problem 5&lt;/p&gt;&lt;p style="margin-bottom: 12pt;"&gt;Given the 3 quiz grades of the student, Quiz1: 80 , Quiz2: 82, Quiz3: 78. Draw a flowchart that would compute for the average grade. Display your answer, and print “Passed” if the average grade is greater than or equal to 80, else print “Failed”.&lt;/p&gt;&lt;p style="margin-bottom: 12pt;"&gt;Solution (Flowchart):&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R0mEW5rm0JI/AAAAAAAAADU/Fic3OHHwjQE/s1600-h/image001.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R0mEW5rm0JI/AAAAAAAAADU/Fic3OHHwjQE/s400/image001.gif" alt="" id="BLOGGER_PHOTO_ID_5136782378968469650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;As you can see, the hexagon initializes the variables to be used in the entire flow.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0q-Ckl3uxI/AAAAAAAAADk/HnFvXPhumuE/s1600-h/image004.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0q-Ckl3uxI/AAAAAAAAADk/HnFvXPhumuE/s400/image004.gif" alt="" id="BLOGGER_PHOTO_ID_5137127276361005842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;We have computed for the sum of the three quiz grades and the average:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R0q-c0l3uzI/AAAAAAAAAD0/FjVMpKLg48A/s1600-h/image005.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R0q-c0l3uzI/AAAAAAAAAD0/FjVMpKLg48A/s400/image005.gif" alt="" id="BLOGGER_PHOTO_ID_5137127727332571954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Or we can do this and still get the average:&lt;br /&gt;&lt;br /&gt;Average = (Quiz1 + Quiz2 + Quiz3) / 3&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;The open and close parenthesis is used to group the 3 quizzes then divided by 3 to get the average grade. Either way we still get the result.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;The diamond is where we determine if the computed average grade is greater than or equal to 80.&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R0q_LUl3u0I/AAAAAAAAAD8/4ysXUXNFPRA/s1600-h/image007.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R0q_LUl3u0I/AAAAAAAAAD8/4ysXUXNFPRA/s400/image007.gif" alt="" id="BLOGGER_PHOTO_ID_5137128526196489026" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;the flow then branches out, one on the left if it satisfies the average &gt;= 80, else it branches at the bottom of the diamond, and prints the desired output, depending on the average grade that was computed. &gt;= 80 prints “passed” , &lt;span style=""&gt; &lt;/span&gt;“failed” if &lt;&gt;&lt;br /&gt;&lt;br /&gt;Problem 6&lt;br /&gt;&lt;br /&gt;Input the Name and Gender of a person. Print the Name and “You are male” if gender is ‘M’ else print “You are female”.&lt;br /&gt;&lt;br /&gt;Solution (Flowchart):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R0mEpZrm0KI/AAAAAAAAADc/ANn4hF8K4TU/s1600-h/image002.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R0mEpZrm0KI/AAAAAAAAADc/ANn4hF8K4TU/s400/image002.gif" alt="" id="BLOGGER_PHOTO_ID_5136782696796049570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;Again, we initialized the variables needed, but this time we get our data from the keyboard (user types in the name and gender), then test if the inputted gender is “M” for male or “F” for female. If male then we print “You are male” on the screen else “You are female”.&lt;br /&gt;&lt;br /&gt;Are you up to solve the next problem? Let’s try:&lt;br /&gt;&lt;br /&gt;Problem 7&lt;/p&gt;&lt;p class="MsoNormal"&gt;Draw a flowchart that would input the name, age and gender of a person, print “Hello” if age is less than or equal to 59, else “Hi” and print also the name.&lt;br /&gt;&lt;br /&gt;It’s very simple, just follow the previous flowchart examples.&lt;br /&gt;&lt;br /&gt;Well that’s it for now.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;-End of lesson 4 Beginners Programming&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7054004109324125889-1028174015015783362?l=beginners-programming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/1028174015015783362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7054004109324125889&amp;postID=1028174015015783362' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/1028174015015783362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/1028174015015783362'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/2007/11/chapter-1-lesson-4.html' title='Chapter 1, Lesson 4'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_xO73aeIheW8/R1gwlVrC2pI/AAAAAAAAAF0/VOsqXlldgts/s72-c/image001.gif' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7054004109324125889.post-8049667785369856721</id><published>2007-11-24T06:01:00.000-08:00</published><updated>2007-12-07T10:58:10.836-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chapter 1'/><title type='text'>Chapter 1, Lesson 3</title><content type='html'>Welcome to Beginners Programming.&lt;br /&gt;&lt;br /&gt;A bit of c language, I'm just going to give you an idea what a C program looks like, but our C language will be on the later chapters, for we are going to dig first the flowchart. Well you can also &lt;a href="http://beginners-programming.blogspot.com/2007/11/chapter-1-lesson-4.html"&gt;skip to lesson 4&lt;/a&gt; if you like.&lt;br /&gt;&lt;br /&gt;Our lesson now is to display a STRING somewhere on the  screen.  Well, we can use escape  characters but I’m going to use the &lt;em&gt;gotoxy&lt;/em&gt; function on our tutorial.&lt;br /&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R0gxJWVE3YI/AAAAAAAAAB8/DX6Tq1p0Uw8/s1600-h/clip_image002.gif"&gt;&lt;/a&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R0gxJWVE3YI/AAAAAAAAAB8/DX6Tq1p0Uw8/s1600-h/clip_image002.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R0gxJWVE3YI/AAAAAAAAAB8/DX6Tq1p0Uw8/s400/clip_image002.gif" alt="" id="BLOGGER_PHOTO_ID_5136409411698613634" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;Whenever I say “hello world!”, I am also  referring to alphanumeric (0-9, a-z, A-Z etc..) characters enclosed with quotes  “ ”, which is also called as STRING.&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;GotoXY is a function  or procedure that positions the insertion or cursor at (X,Y). X  in horizontal, Y in vertical direction relative to the origin of the  current window.  The origin is located at  (1,1), the upper-left corner of the window.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;DOS based program has a number of  characters across and down. 80 characters across (horizontal) and 25 characters  in down (vertical). &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Figure 1&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0gxZ2VE3ZI/AAAAAAAAACE/aD4IgPyzIS0/s1600-h/clip_image004.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 456px; height: 230px;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0gxZ2VE3ZI/AAAAAAAAACE/aD4IgPyzIS0/s400/clip_image004.jpg" alt="" id="BLOGGER_PHOTO_ID_5136409695166455186" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;We just imagine were graphing  lines during our geometry lessons. But in geometry, the (1,1) coordinates  starts at the bottom left.  In our case  we use the top left corner as our (1,1) coordinates. Remember that x-axis is 80  characters and the y-axis is 25 characters. Now if we display a STRING at  location (40,12), it simply means to position the cursor 40 characters in the &lt;em&gt;X&lt;/em&gt; position and 12 characters in the &lt;em&gt;Y&lt;/em&gt; position.  Let’s say we print the STRING A (“A”) in the  center of the screen.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Flowchart:&lt;br /&gt;&lt;br /&gt;Figure 2&lt;/p&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R1gg4VrC2mI/AAAAAAAAAFc/mMKnQsKAlUE/s1600-h/image008.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R1gg4VrC2mI/AAAAAAAAAFc/mMKnQsKAlUE/s400/image008.gif" alt="" id="BLOGGER_PHOTO_ID_5140895126905870946" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Code:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre style="font-family: courier new;"&gt;&lt;br /&gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;conio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;gotoxy(40,12);&lt;br /&gt;&lt;br /&gt;printf(“A”);&lt;br /&gt;return 0;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Output :&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Figure 3&lt;/p&gt;1----------------------------------------40-------------------------------------------80&lt;br /&gt;&lt;table style="width: 399px; height: 287px;" border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" width="557"&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R0gx-WVE3bI/AAAAAAAAACU/Vbva1ztEO3c/s1600-h/clip_image007.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 447px; height: 226px;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R0gx-WVE3bI/AAAAAAAAACU/Vbva1ztEO3c/s400/clip_image007.jpg" alt="" id="BLOGGER_PHOTO_ID_5136410322231680434" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody&gt;&lt;br /&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p&gt;As you will notice, I included the conio.h file, where the  gotoxy was defined. &lt;/p&gt;Lets try printing a simple program displaying Christmas Tree  using “*” .&lt;br /&gt;&lt;p&gt;Flowchart:&lt;br /&gt;&lt;br /&gt;Figure 4&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R1gjZFrC2oI/AAAAAAAAAFs/HTdtYNxL7Ik/s1600-h/image005.gif"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R1gjZFrC2oI/AAAAAAAAAFs/HTdtYNxL7Ik/s400/image005.gif" alt="" id="BLOGGER_PHOTO_ID_5140897888569842306" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Code:&lt;/p&gt;&lt;p class="style2"&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &lt;/code&gt;&lt;code&gt;&amp;lt;conio.h&amp;gt;&lt;/code&gt;&lt;code&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;clrscr();&lt;br /&gt;printf(“      *     ”);&lt;br /&gt;printf(“     ***    ”);&lt;br /&gt;printf(“    *****   ”);&lt;br /&gt;printf(“   *******  ”);&lt;br /&gt;printf(“ ********* ”);&lt;br /&gt;printf(“***********”);&lt;br /&gt;printf(“      *     ”);&lt;br /&gt;printf(“      *     ”);&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Output :&lt;br /&gt;&lt;br /&gt;Figure 5&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0gys2VE3dI/AAAAAAAAACk/AyFTvp9Pmic/s1600-h/clip_image010.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 456px; height: 230px;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0gys2VE3dI/AAAAAAAAACk/AyFTvp9Pmic/s400/clip_image010.jpg" alt="" id="BLOGGER_PHOTO_ID_5136411121095597522" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;How can we center the tree?   By using &lt;em&gt;gotoxy&lt;/em&gt; function we  can center the tree on the output screen.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R0gxJWVE3YI/AAAAAAAAAB8/DX6Tq1p0Uw8/s1600-h/clip_image002.gif"&gt;&lt;/a&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R0gxJWVE3YI/AAAAAAAAAB8/DX6Tq1p0Uw8/s1600-h/clip_image002.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R0gxJWVE3YI/AAAAAAAAAB8/DX6Tq1p0Uw8/s400/clip_image002.gif" alt="" id="BLOGGER_PHOTO_ID_5136409411698613634" border="0" /&gt;&lt;/a&gt;clrscr(); - this function is used to clear  the screen.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Code:&lt;br /&gt;&lt;/p&gt;&lt;pre style=""&gt;&lt;br /&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &lt;/code&gt;&lt;code&gt;&amp;lt;conio.h&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;clrscr();&lt;br /&gt;gotoxy(35,3);   printf(“     *      ”);&lt;br /&gt;gotoxy(35,4);   printf(“    ***     ”);&lt;br /&gt;gotoxy(35,5);   printf(“   *****    ”);&lt;br /&gt;gotoxy(35,6);   printf(“  *******   ”);&lt;br /&gt;gotoxy(35,7);   printf(“  ********* ”);&lt;br /&gt;gotoxy(35,8);   printf(“***********”);&lt;br /&gt;gotoxy(35,9);   printf(“     *      ”);&lt;br /&gt;gotoxy(35,10);  printf(“      *     ”);&lt;br /&gt;return 0;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;Figure 6&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0gyw2VE3eI/AAAAAAAAACs/SHQejA-uuh8/s1600-h/clip_image012.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 477px; height: 240px;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0gyw2VE3eI/AAAAAAAAACs/SHQejA-uuh8/s400/clip_image012.jpg" alt="" id="BLOGGER_PHOTO_ID_5136411189815074274" border="0" /&gt;&lt;/a&gt;&lt;p&gt;&lt;/p&gt;There you go… The tree is now centered…&lt;br /&gt;&lt;p&gt;There are lots of things you can do with the &lt;em&gt;gotoxy&lt;/em&gt; like displaying a box, a triangle  or something else you want. Go ahead and try some different shapes. &lt;/p&gt;Next lesson, more on flowcharting...&lt;br /&gt;&lt;br /&gt;&lt;p&gt;-End of lesson 3 Beginners Programming&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7054004109324125889-8049667785369856721?l=beginners-programming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/8049667785369856721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7054004109324125889&amp;postID=8049667785369856721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/8049667785369856721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/8049667785369856721'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/2007/11/our-lesson-now-is-to-display-string.html' title='Chapter 1, Lesson 3'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xO73aeIheW8/R0gxJWVE3YI/AAAAAAAAAB8/DX6Tq1p0Uw8/s72-c/clip_image002.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7054004109324125889.post-3585508958253282009</id><published>2007-11-23T02:06:00.000-08:00</published><updated>2007-12-07T10:57:41.019-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chapter 1'/><title type='text'>Chapter 1, Lesson 2</title><content type='html'>Welcome to Beginners Programming.&lt;span style=""&gt;  &lt;/span&gt;        &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt;&lt;/o:p&gt;The first time I wrote a program was just to display “hello world!” on the screen.&lt;span style=""&gt;  &lt;/span&gt;It was not a PC though, I cannot remember the model of that gadget but surely the label was “ATARI”.&lt;span style=""&gt;  &lt;/span&gt;During that time, computer games was like squares and circles, it was that time of “Space Invaders” or at least it was. Those were the days, computer games today changed tremendously. &lt;/p&gt;    &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt;&lt;/o:p&gt;Now let’s try to make a simple program which displays “Hello World” on the screen.&lt;/p&gt;      &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt;&lt;/o:p&gt;Figure 1:&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: left;"&gt;Flowchart: (please see lesson1 for basic flowchart symbols)&lt;o:p&gt; &lt;/o:p&gt;&lt;/div&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;     &lt;p class="MsoNormal" style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R1gev1rC2lI/AAAAAAAAAFU/Cs6iSp_VmQE/s1600-h/image002.gif"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R1gev1rC2lI/AAAAAAAAAFU/Cs6iSp_VmQE/s400/image002.gif" alt="" id="BLOGGER_PHOTO_ID_5140892781853727314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;Above the graphical representation of a program which prints “Hello World!” on the screen. Now we are going to translate the flowchart using Pascal, C and C++ programming languages.&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse; width: 498px; height: 168px;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 146.05pt;" valign="top" width="195"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Pascal Code&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 145.8pt;" valign="top" width="194"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;C Code&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 144.85pt;" valign="top" width="193"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;C++ Code&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; padding: 0in 5.4pt; width: 146.05pt;" valign="top" width="195"&gt;&lt;pre&gt;&lt;span style="font-size:1em;"&gt;&lt;br /&gt;Program HelloWorld;&lt;br /&gt;uses crt;&lt;br /&gt;begin&lt;br /&gt;writeln("Hello World!");&lt;br /&gt;end.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;  &lt;/td&gt;   &lt;td style="border-style: none solid solid none; padding: 0in 5.4pt; width: 145.8pt;" valign="top" width="194"&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-size:1em;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;printf("Hello World!\n");&lt;br /&gt;return 0;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;/td&gt;   &lt;td  style="border-style: none solid solid none; padding: 0in 5.4pt; width: 144.85pt;font-family:arial;" valign="top" width="193"&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-size:1em;"&gt;#include &amp;lt;iostream.h&amp;gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;cout &lt;/span&gt;&lt;span&gt;&lt;span style="font-size:1em;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-size:1em;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:1em;"&gt; "Hello World!\n";&lt;br /&gt;return 0;&lt;br /&gt;} &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;The flowchart will serve as your blueprint, your guide developing a program. &lt;span style=""&gt; &lt;/span&gt;But as I have mentioned earlier, our world will be evolving within the C language. &lt;span style=""&gt; &lt;/span&gt;By the way, we will be using Borland C/C++ IDE, a DOS based program. If you do not have Borland C/C++ IDE you can download it from &lt;a href="http://www.simonhuggins.com/courses/progbegin/c/download/TCLITE.exe"&gt;http://www.simonhuggins.com/courses/progbegin/c/download/index.htm&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;The Code: &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;pre&gt;#Include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;printf("Hello World!\n");&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Note: C language is case sensitive meaning, capital letter &lt;i style=""&gt;N&lt;/i&gt; is not the same as small letter &lt;i style=""&gt;n&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Dissection:&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 116.6pt;" valign="top" width="155"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;span style="font-size:85%;"&gt;#Include&lt;/span&gt; &lt;stdio.h&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; padding: 0in 5.4pt; width: 279pt;" valign="top" width="372"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Tells the processor to treat   the contents of the file &lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Arial;"&gt;stdio.h&lt;/span&gt;&lt;/b&gt;&lt;/span&gt; as if the   contents had appeared in the source program at the point where the directive   appears&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; padding: 0in 5.4pt; width: 116.6pt;" valign="top" width="155"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;span style="font-size:85%;"&gt;stdio.h&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; padding: 0in 5.4pt; width: 279pt;" valign="top" width="372"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Which stands for "standard   input/output header", is the header in the C standard library that   contains macro definitions, constants, and declarations of functions and   types used for various standard input and output operations&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; padding: 0in 5.4pt; width: 116.6pt;" valign="top" width="155"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;span style="font-size:85%;"&gt;int main(void)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; padding: 0in 5.4pt; width: 279pt;" valign="top" width="372"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;It is a special purpose   function in C programs. When the program is then run or executed, the runtime   environment will first call the &lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Arial;"&gt;main&lt;/span&gt;&lt;/b&gt;&lt;/span&gt; function otherwise   it will be like some other function in the program.&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; padding: 0in 5.4pt; width: 116.6pt;" valign="top" width="155"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;span style="font-size:85%;"&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; padding: 0in 5.4pt; width: 279pt;" valign="top" width="372"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;The open curly brace indicates   the beginning of the definition of the main function&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; padding: 0in 5.4pt; width: 116.6pt;" valign="top" width="155"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;span style="font-size:85%;"&gt;printf(“Hello World!\n”);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; padding: 0in 5.4pt; width: 279pt;" valign="top" width="372"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;This line &lt;i&gt;calls&lt;/i&gt;   (executes the code for) a function named &lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;a href="http://en.wikipedia.org/wiki/Printf" title="Printf"&gt;&lt;span style=""&gt;printf&lt;/span&gt;&lt;/a&gt;&lt;/code&gt;&lt;/span&gt;,   which is declared in the included header &lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;a href="http://en.wikipedia.org/wiki/Stdio.h"&gt;stdio.h&lt;/a&gt;&lt;/code&gt;&lt;/span&gt; and   supplied from a system &lt;a href="http://en.wikipedia.org/wiki/Library_%28computer_science%29" title="Library (computer science)"&gt;library&lt;/a&gt;. The &lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;b style=""&gt;\n&lt;/b&gt;&lt;/code&gt;&lt;/span&gt;   is an &lt;i&gt;escape sequence&lt;/i&gt; that C translates to the &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Newline" title="Newline"&gt;newline&lt;/a&gt;&lt;/i&gt;   character, which on output signifies the end of the current line. The return   value of the &lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;b style=""&gt;printf&lt;/b&gt;&lt;/code&gt;&lt;/span&gt; function is of type &lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;b style=""&gt;int&lt;/b&gt;&lt;/code&gt;&lt;/span&gt;,   but it is silently discarded since it is not used by the caller. (A more   careful program might test the return value to determine whether or not the &lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;b style=""&gt;printf&lt;/b&gt;&lt;/code&gt;&lt;/span&gt;   function succeeded.) The semicolon &lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;b style=""&gt;;&lt;/b&gt;&lt;/code&gt;&lt;/span&gt; terminates the statement, and   the following blank line is simply ignored.&lt;span style=""&gt;    &lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;*from &lt;a href="http://www.wikipedia.org/"&gt;wikipedia&lt;/a&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; padding: 0in 5.4pt; width: 116.6pt;" valign="top" width="155"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;return 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; padding: 0in 5.4pt; width: 279pt;" valign="top" width="372"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;This line terminates the   execution of the &lt;span style="font-size:100%;"&gt;&lt;code&gt;main&lt;/code&gt;   &lt;/span&gt;function and causes it to return the integer value 0, which is interpreted by   the run-time system as an exit code (indicating successful execution).&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; padding: 0in 5.4pt; width: 116.6pt;" valign="top" width="155"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 279pt;" valign="top" width="372"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;The open curly brace indicates   the end of the definition of the main function&lt;/p&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Ok, so now are you ready to run the program?&lt;span style=""&gt;  &lt;/span&gt;Running the program is just easy, like MSWord, the shortcut key for save is&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;CTRL+S (save document). In our case &lt;b style=""&gt;CTRL+F9 &lt;/b&gt;(execute the program) &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:wrapblock&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;   &lt;v:stroke joinstyle="miter"&gt;   &lt;v:formulas&gt;    &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;    &lt;v:f eqn="sum @0 1 0"&gt;    &lt;v:f eqn="sum 0 0 @1"&gt;    &lt;v:f eqn="prod @2 1 2"&gt;    &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;    &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;    &lt;v:f eqn="sum @0 0 1"&gt;    &lt;v:f eqn="prod @6 1 2"&gt;    &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;    &lt;v:f eqn="sum @8 21600 0"&gt;    &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;    &lt;v:f eqn="sum @10 21600 0"&gt;   &lt;/v:f&gt;   &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;   &lt;o:lock ext="edit" aspectratio="t"&gt;  &lt;/o:lock&gt;&lt;v:shape id="_x0000_s1032" type="#_x0000_t75" style="" allowoverlap="f"&gt;   &lt;v:imagedata src="file:///C:%5CDOCUME%7E1%5CSuperman%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image002.wmz" title=""&gt;   &lt;w:wrap type="topAndBottom"&gt;  &lt;/w:wrap&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0aoMWVE3RI/AAAAAAAAABE/3I_MNRjhoQU/s1600-h/image004.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0aoMWVE3RI/AAAAAAAAABE/3I_MNRjhoQU/s400/image004.gif" alt="" id="BLOGGER_PHOTO_ID_5135977355168505106" border="0" /&gt;&lt;/a&gt;&lt;/v:imagedata&gt;  &lt;/v:shape&gt;&lt;/v:path&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;/o:wrapblock&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;You will notice that your program will just flicker or you will not notice it at all. “what then? Nothing happened…”, well something did happen, the IDE successfully executed your program.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;v:shape id="_x0000_i1028" type="#_x0000_t75" style="" allowoverlap="f"&gt;  &lt;v:imagedata src="file:///C:%5CDOCUME%7E1%5CSuperman%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image004.wmz" title="MCj04344030000[1]"&gt; &lt;/v:imagedata&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R0aofmVE3TI/AAAAAAAAABU/zztDzsFOYWk/s1600-h/image012.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R0aofmVE3TI/AAAAAAAAABU/zztDzsFOYWk/s400/image012.gif" alt="" id="BLOGGER_PHOTO_ID_5135977685880986930" border="0" /&gt;&lt;/a&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;br /&gt;&lt;/v:shape&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;“Really?” &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;If you want to see the output, press CTRL+F5.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Figure 2:&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Output:&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" style=""&gt;  &lt;v:imagedata src="file:///C:%5CDOCUME%7E1%5CSuperman%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image006.png" title=""&gt; &lt;/v:imagedata&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R0aovGVE3UI/AAAAAAAAABc/Lkr8awzhzHI/s1600-h/image009.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R0aovGVE3UI/AAAAAAAAABc/Lkr8awzhzHI/s400/image009.jpg" alt="" id="BLOGGER_PHOTO_ID_5135977952168959298" border="0" /&gt;&lt;/a&gt;&lt;/v:shape&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;v:shape id="_x0000_i1026" type="#_x0000_t75" style=""&gt;  &lt;v:imagedata src="file:///C:%5CDOCUME%7E1%5CSuperman%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image008.wmz" title=""&gt; &lt;/v:imagedata&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0apFWVE3WI/AAAAAAAAABs/LTRaYD76LM0/s1600-h/image015.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0apFWVE3WI/AAAAAAAAABs/LTRaYD76LM0/s400/image015.gif" alt="" id="BLOGGER_PHOTO_ID_5135978334421048674" border="0" /&gt;&lt;/a&gt;&lt;/v:shape&gt;&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;And you have your output. CONGRATULATIONS! &lt;span style=""&gt; &lt;/span&gt;You created your first program.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;You can add as may printf as you want in your code. Go ahead try it.. explore… &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;        &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;printf(“this is a C program\n”);&lt;br /&gt;printf(“Im gonna love this\n”);&lt;br /&gt;printf(“its really fun\n”);&lt;br /&gt;printf(“thank you very much\n”);&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Well that’s it for now. I hope I have gotten your feet wet. &lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;Next lesson in beginners programming, we will be learning how to display “hello world!” somewhere on the screen.&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0apkWVE3XI/AAAAAAAAAB0/QsOH64XliFk/s1600-h/image013.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0apkWVE3XI/AAAAAAAAAB0/QsOH64XliFk/s400/image013.gif" alt="" id="BLOGGER_PHOTO_ID_5135978866996993394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;-End of lesson 2 Beginners Programming&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7054004109324125889-3585508958253282009?l=beginners-programming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/3585508958253282009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7054004109324125889&amp;postID=3585508958253282009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/3585508958253282009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/3585508958253282009'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/2007/11/welcome-to-beginners-programming_23.html' title='Chapter 1, Lesson 2'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xO73aeIheW8/R1gev1rC2lI/AAAAAAAAAFU/Cs6iSp_VmQE/s72-c/image002.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7054004109324125889.post-3364469122753218424</id><published>2007-11-21T18:34:00.000-08:00</published><updated>2007-12-07T10:57:10.923-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chapter 1'/><title type='text'>Chapter 1, Lesson 1</title><content type='html'>Welcome to Beginners Programming.&lt;br /&gt;&lt;br /&gt;First thing’s first, English is not my native language so please excuse me for my bad English.&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xO73aeIheW8/R0TrR3xzHpI/AAAAAAAAAAM/9aMzC4JAevA/s1600-h/image002.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_xO73aeIheW8/R0TrR3xzHpI/AAAAAAAAAAM/9aMzC4JAevA/s320/image002.gif" alt="" id="BLOGGER_PHOTO_ID_5135488167372332690" border="0" /&gt;&lt;/a&gt;There are two main ways to write a computer program, Graphically, by using flowcharts and by using computer programming languages, such as BASIC, C/C++, Pascal, C#, Java, etc..&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;But let us learn the basics of programming. The first thing you have to know is how did computer programming came into being.&lt;span style=""&gt;  &lt;/span&gt;It all started with algorithm. Algorithm &lt;span class="prondelim"&gt;[&lt;/span&gt;&lt;span class="pron"&gt;&lt;b&gt;al&lt;/b&gt;-g&lt;i&gt;uh&lt;/i&gt;-ri&lt;i&gt;th&lt;/i&gt;-&lt;span style="font-style: italic;"&gt;uh&lt;/span&gt;&lt;/span&gt;&lt;span class="pron"&gt;m&lt;/span&gt;&lt;span class="prondelim"&gt;]&lt;/span&gt; &lt;b&gt;(n.)&lt;/b&gt;&lt;span style=""&gt;  &lt;/span&gt;It is a step by step instructions to solving a given task.&lt;span style=""&gt;  &lt;/span&gt;One good example is the recipe.   &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Recipe for Making a Coffee&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Get      the Coffee Jar&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Scoop      a bit of coffee into coffee cup.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Scoop      a bit of sugar into coffee cup.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Pour      hot water into coffee cup&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Stir      as desired&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Drink      the coffee when ready.&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;We have been using algorithms all our life and we have not notice it.&lt;span style=""&gt;  &lt;/span&gt;Like how to tie your shoe laces. When you buy your first microwave oven, or a gadget, you read the instructions on how to operate, and there you will see a series of steps (algorithm)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;The algorithm is then converted to a &lt;a href="http://www.sedoparking.com/parking.php4?task=search&amp;amp;domain=global-pinoy.com&amp;amp;trackquery=1&amp;amp;s=52d4634e086a4d0284dc&amp;amp;a_id=1&amp;amp;language=en&amp;amp;pgt=ltKSbZdIIIEKEwiSjpPwvO-PAhUUfGgKHboQ6koYAyAAMNHvoAM4DQ&amp;amp;pxy_t=254&amp;amp;start=1&amp;amp;add_c=a523e12507f37b956c3bdba718e87030&amp;amp;keyword=UML"&gt;graphic representation&lt;/a&gt;, using symbols interconnected with flow lines, of the successive steps in a procedure or system.&lt;span style=""&gt;  &lt;/span&gt;It is called Flowchart.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0TrwHxzHqI/AAAAAAAAAAU/B_vbDRNcP30/s1600-h/image006.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0TrwHxzHqI/AAAAAAAAAAU/B_vbDRNcP30/s320/image006.jpg" alt="" id="BLOGGER_PHOTO_ID_5135488687063375522" border="0" /&gt;&lt;/a&gt;  &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a href="http://www.sedoparking.com/parking.php4?task=search&amp;amp;domain=global-pinoy.com&amp;amp;trackquery=1&amp;amp;s=52d4634e086a4d0284dc&amp;amp;a_id=1&amp;amp;language=en&amp;amp;pgt=d9u1H0-tR3sKEwiX2tSzvO-PAhUTZWgKHct3cVAYAyAAMNHvoAM4DQ&amp;amp;pxy_t=254&amp;amp;start=1&amp;amp;add_c=a523e12507f37b956c3bdba718e87030&amp;amp;keyword=flowchart+symbols"&gt;Basic flowchart symbols&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xO73aeIheW8/R0TsPHxzHsI/AAAAAAAAAAk/17Ph2J-DtRk/s1600-h/image008.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_xO73aeIheW8/R0TsPHxzHsI/AAAAAAAAAAk/17Ph2J-DtRk/s400/image008.jpg" alt="" id="BLOGGER_PHOTO_ID_5135489219639320258" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Lets do a little exercise.&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Problem: Given the 3 quiz grades of the student, Quiz1: 80, Quiz2:82, Quiz3:78. Write and algorithm and draw a flowchart that would compute for the average grade and display your answer.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Algorithm:&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;let x1      = 80, x2 = 82, x3 = 78&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;let      sum = x1 + x2 + x3&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;let      average = sum / 3&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;display      the average&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;v:group id="_x0000_s1028" style="" coordorigin="4642,11079" coordsize="1800,4012"&gt;&lt;v:shapetype id="_x0000_t116" coordsize="21600,21600" spt="116" path="m3475,qx,10800,3475,21600l18125,21600qx21600,10800,18125,xe"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;v:path gradientshapeok="t" connecttype="rect" textboxrect="1018,3163,20582,18437"&gt;&lt;/v:path&gt;&lt;v:shape id="_x0000_s1029" type="#_x0000_t116" style=""&gt;&lt;v:textbox&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;/v:group&gt;&lt;v:shapetype id="_x0000_t117" coordsize="21600,21600" spt="117" path="m4353,l17214,r4386,10800l17214,21600r-12861,l,10800xe"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;v:path gradientshapeok="t" connecttype="rect" textboxrect="4353,0,17214,21600"&gt;&lt;/v:path&gt;&lt;v:shape id="_x0000_s1030" type="#_x0000_t117" style=""&gt;&lt;v:textbox&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;v:shapetype id="_x0000_t109" coordsize="21600,21600" spt="109" path="m,l,21600r21600,l21600,xe"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;v:path gradientshapeok="t" connecttype="rect"&gt;&lt;/v:path&gt;&lt;v:shape id="_x0000_s1031" type="#_x0000_t109" style=""&gt;&lt;v:textbox&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;v:shape id="_x0000_s1032" type="#_x0000_t109" style=""&gt;&lt;v:textbox&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;v:shapetype id="_x0000_t111" coordsize="21600,21600" spt="111" path="m4321,l21600,,17204,21600,,21600xe"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;v:path gradientshapeok="t" connecttype="custom" connectlocs="12961,0;10800,0;2161,10800;8602,21600;10800,21600;19402,10800" textboxrect="4321,0,17204,21600"&gt;&lt;/v:path&gt;&lt;v:shape id="_x0000_s1033" type="#_x0000_t111" style=""&gt;&lt;v:textbox&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;v:shape id="_x0000_s1034" type="#_x0000_t116" style=""&gt;&lt;v:textbox&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;v:line id="_x0000_s1035" style="" from="5542,11387" to="5543,11696" coordsize="21600,21600"&gt;&lt;v:stroke endarrow="block"&gt;&lt;/v:stroke&gt;&lt;v:line id="_x0000_s1036" style="" from="5542,12467" to="5543,12776" coordsize="21600,21600"&gt;&lt;v:stroke endarrow="block"&gt;&lt;/v:stroke&gt;&lt;v:line id="_x0000_s1037" style="" from="5542,13084" to="5543,13393" coordsize="21600,21600"&gt;&lt;v:stroke endarrow="block"&gt;&lt;/v:stroke&gt;&lt;v:line id="_x0000_s1038" style="" from="5542,13702" to="5543,14010" coordsize="21600,21600"&gt;&lt;v:stroke endarrow="block"&gt;&lt;/v:stroke&gt;&lt;v:line id="_x0000_s1039" style="" from="5542,14473" to="5543,14782" coordsize="21600,21600"&gt;&lt;v:stroke endarrow="block"&gt;&lt;/v:stroke&gt;&lt;/v:line&gt;Flowchart:&lt;/v:line&gt;&lt;/v:line&gt;&lt;/v:line&gt;&lt;/v:line&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xO73aeIheW8/R0Ts7XxzHtI/AAAAAAAAAAs/_Vk0v9IZ_pc/s1600-h/image009.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_xO73aeIheW8/R0Ts7XxzHtI/AAAAAAAAAAs/_Vk0v9IZ_pc/s400/image009.gif" alt="" id="BLOGGER_PHOTO_ID_5135489979848531666" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Another example using &lt;a href="http://www.sedoparking.com/parking.php4?task=search&amp;amp;domain=global-pinoy.com&amp;amp;trackquery=1&amp;amp;s=52d4634e086a4d0284dc&amp;amp;a_id=1&amp;amp;language=en&amp;amp;pgt=7jg3OyzYj-QKEwihksqxvO-PAhUBaF4KHdtvArMYAyAAMNHvoAM4DQ&amp;amp;pxy_t=254&amp;amp;start=1&amp;amp;add_c=a523e12507f37b956c3bdba718e87030&amp;amp;keyword=Perl"&gt;Perl program&lt;/a&gt;.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; width: 481px; margin-left: -12.6pt; border-collapse: collapse; height: 381px;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td  style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 4in;font-family:arial;" valign="top" width="384"&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;graph&lt;span style=""&gt;         &lt;/span&gt;{ flow: south; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;node.start&lt;span style=""&gt;    &lt;/span&gt;{ shape: rounded; fill: #ffbfc9; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;node.question { shape: diamond; fill: #ffff8a; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;node.action&lt;span style=""&gt;   &lt;/span&gt;{ shape: rounded; fill: #8bef91; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;[ Lamp doesn't work ] { class: start }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style=""&gt;  &lt;/span&gt;--&gt; [ Lamp\n plugged in? ] { class: question; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style=""&gt;   &lt;/span&gt;-- No --&gt; [ Plug in lamp ] { class: action; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;[ Lamp\n plugged in? ]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style=""&gt;  &lt;/span&gt;--&gt; [ Bulb\n burned out? ] { class: question; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style=""&gt;   &lt;/span&gt;-- Yes --&gt; [ Replace bulb ] { class: action; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;[ Bulb\n burned out? ]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size:9;"&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;  &lt;/span&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;-- No --&gt; [ Buy new lamp ] { class: action; }&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-size:9;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 207pt;" valign="top" width="276"&gt;     &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xO73aeIheW8/R0TtXnxzHuI/AAAAAAAAAA0/Bd1DhMx9jMc/s1600-h/image011.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_xO73aeIheW8/R0TtXnxzHuI/AAAAAAAAAA0/Bd1DhMx9jMc/s400/image011.jpg" alt="" id="BLOGGER_PHOTO_ID_5135490465179836130" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;Wikipedia – Flowchart &lt;a href="http://en.wikipedia.org/wiki/Flowchart"&gt;http://en.wikipedia.org/wiki/Flowchart&lt;/a&gt;&lt;/p&gt;On the left side is the Perl Code or program in which just a series of text instructions (algorithm) to be executed. And on the right side is the graphical representation (flowchart).    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;As you can see, the program or series of instructions is clearly understood using graphical flowchart.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  By the way, I would also inform you that the language we will be using is the C Language.  And i would assume that you have a little knowledge in C Syntax.  You can search the net for C Syntax.&lt;br /&gt;&lt;br /&gt;In our next lesson, we will have simple problems, flowchart making and Create a C program translated from flowchart. If you learn this simple steps , you can create programs using any programming language you want. At Beginners Programming, we will be your guide.&lt;br /&gt;&lt;br /&gt;-End of lesson 1 Beginners Programming&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7054004109324125889-3364469122753218424?l=beginners-programming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/3364469122753218424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7054004109324125889&amp;postID=3364469122753218424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/3364469122753218424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/3364469122753218424'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/2007/11/welcome-to-beginners-programming_21.html' title='Chapter 1, Lesson 1'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xO73aeIheW8/R0TrR3xzHpI/AAAAAAAAAAM/9aMzC4JAevA/s72-c/image002.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7054004109324125889.post-1766547314090964272</id><published>2007-11-21T06:34:00.000-08:00</published><updated>2007-12-09T01:02:41.553-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chapter 1'/><title type='text'>Chapter 1, Introduction</title><content type='html'>Welcome and thank you for visiting my blog, Beginners Programming&lt;br /&gt;&lt;br /&gt;My blog will provide a step by step easy to follow programming techniques and "how to program" lessons that will help you get started on the right foot with Programming.  It is actually a programming for beginners guide.  I posted blogs about how to draw a flowchart,  interpret flowchart and translate the flowchart to a program.  Since this is a programming for beginners guide, i promise i will go easy on the subject.&lt;br /&gt;&lt;br /&gt;&lt;!-- beginners guide to programming //--&gt; &lt;!-- beginners programming //--&gt;To begin, check out &lt;a href="http://beginners-programming.blogspot.com/2007/11/welcome-to-beginners-programming_21.html"&gt;Beginners Programming  Lesson 1&lt;/a&gt; &lt;!-- programming for beginners //--&gt; &lt;!-- programming //--&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7054004109324125889-1766547314090964272?l=beginners-programming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://beginners-programming.blogspot.com/feeds/1766547314090964272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7054004109324125889&amp;postID=1766547314090964272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/1766547314090964272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7054004109324125889/posts/default/1766547314090964272'/><link rel='alternate' type='text/html' href='http://beginners-programming.blogspot.com/2007/11/welcome-to-beginners-programming.html' title='Chapter 1, Introduction'/><author><name>S.C.3</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
