Blog
Essay Question Responses
Name
Professor
Course
Date
Essay Question Responses
1) There are two types of loops – pretest and posttest. Give an example of each and explain when we would use each.
Looping is a form of repetition control structure in which an iterative process is conducted. In this structure, a process is repeated involving a number of algorithmic steps
Basically there are two types of loops; these are the pretest loop and the post test loop. It is important to know that the two loops are different depending on the characteristics o and their functionalities. For example: the pretest loop involves the use of Do statement in VB, they can be followed by “While” or “Until” as the main keywords. For example statement such as do while or do until are implemented in VB. “Do Until” refers to the execution of a statement in the body of a VB loop till a certain condition is true.
“Do While” is a statement in VB , which requires the execution of then body of the statement in a VB loop till while a certain VB statement is true and stops when the statement becomes false. The two statements mean the same thing. Example includes Do While X <= 10, this is the same thing as Do until X > 10. The only difference is the introduction of the true and false parameters in the statements.
Post test loop
In this loop, the test of the loop termination decision is done at the very bottom of the VB loop. The statement in the body of the loop are tested at the last stage of the execution
INCLUDEPICTURE “http://www.thevbprogrammer.com/Ch05/05-04-RepetitionStructure_files/image008.jpg” * MERGEFORMATINET
HYPERLINK “http://nwds-ak.com/WebResources/NET/VBNETCComparison.aspx” http://nwds-ak.com/WebResources/NET/VBNETCComparison.aspx
HYPERLINK “http://www.csc.liv.ac.uk/~frans/OldLectures/COMP101/week7/forLoops.html” http://www.csc.liv.ac.uk/~frans/OldLectures/COMP101/week7/forLoops.html
2.What is a Fibonacci sequence?
This is a series of numbers which exhibit the integer sequence detailed below:0,1,1,2,3,5,8, 13, 21, 34 …… The rule in Fibonacci is that the first two figures are o, and 1, and then the subsequent number is the sum of the two preceding numbers.
How do Fibonacci sequences apply to natural phenomena?
In the natural phenomena, Fibonacci is used in biology to denote the branching nature of trees and their leaves, the distribution of the seed in the fruit called raspberry. These are natural occurrence. This is also mused to explain the fruitless pineapple etc and the Way they develop and reproduce ( Posamentier, & Lehmann, 23).
Why do programmers use an array when working with this mathematical concept? Please provide examples.
Programmers use it to divide an unsorted list into two parts with an approximate length. It is also important in the merging and sorting of arrays into appropriate lengths. This is called a divide and conquers, or merge sort algorithm.
HYPERLINK “http://www.mathacademy.com/pr/prime/articles/fibonac/” http://www.mathacademy.com/pr/prime/articles/fibonac/
HYPERLINK “http://plus.maths.org/content/life-and-numbers-fibonacci” http://plus.maths.org/content/life-and-numbers-fibonacci
HYPERLINK “http://www.swing-trade-stocks.com/fibonacci-retracements.html” http://www.swing-trade-stocks.com/fibonacci-retracements.html
3.One of the advantages to writing a program that is subdivided into methods is that such a structure allows different programmers to write separate methods, thus dividing the work. What is the advantage to this?
The main advantage of this is that the programmers work on deferent projects and normalize out the sequence thereby making the programs stable under various conditions. This is called divide and conquer because it is difficult to write a stable program based on same architectures. Sorting and merging the parts makes the program much more stable. That is why it is advantageous if the programmers work on different projects and merge them later.
Another advantage of dividing a task into smaller portions is to increase the level of engagement in the program so as to handle the inevitable features of the programs. In this way, they programmers w do not communicate what they are doing. Such programs can run a number of codes differently but may be merged to increase the level of stability.
Working on large project requires that the project be divided into smaller portion to different programs; this is the proposal after the realization that most projects have a very large
scope that may not be easy for a single programmer to complete in the face of time constraints.
HYPERLINK “http://msdn.microsoft.com/en-us/library/ff649520.aspx” http://msdn.microsoft.com/en-us/library/ff649520.aspx
HYPERLINK “http://books.google.co.ke/books?id=0aQwgi6qu44C&pg=PA3&lpg=PA3&dq” http://books.google.co.ke/books?id=0aQwgi6qu44C&pg=PA3&lpg=PA3&dq
Works cited
Posamentier, A. & Lehmann, I.: The fabulous Fibonacci numbers. Amherst, NY: Prometheus Books. (2007). Print.
