
4D :
1) ( C )
2) ( B )
3) ( A )
4) ( C )
5) ( B )
6) ( D )
7) ( C )
8) ( C )
9) ( B)
10) ( A )
11) What is an Algorithm ?
An algorithm is a series and sequences of sets of commands in the code. Algorithms
give computers step-by-step instructions to accomplish specific tasks and make decisions. In
programming, there are many ways to solve a problem. However, the effectiveness of the
available methods varies. Some methods are much better than others at giving accurate
answers.
12) What is structured programming? Discuss.
Structured programming encourages dividing an application program into a hierarchy of
modules or autonomous elements, which, in turn, may contain other such elements.
Within each element, code may be further structured using blocks of related logic
designed to improve readability and maintainability.
13) Explain the operation of each of the three fundamental control structures. Use examples
of each as part of your explanation.
There are three fundamental control structures in structured programming,
1. Sequence Control Structure : This refers to the line-by line, in which statements are
executed sequentially, in the same order in which they appear in the script. They might,
for example, carry out a series of read or write operations, arithmetic operations, or
assignments to variables.
2. Decision Control Structure : Depending on whether a condition is true or false, the
decision control structure may skip the execution of an entire block of statements or
even execute one block of statements instead of another.
3. Loop Control Structure : This is a control structure that allows the execution of a block
statement multiple times until a specified condition is met.
14) Create an algorithm that calculates the average of a series of numbers.
Pseudo code representing of the algorithm :