From everyday life, provide and discuss examples of :

sequential, conditional, and iterative operations



How do the ways we state these operations in everyday life differ from the ways we state them in pseudocode?

Why might there be a difference?

Respuesta :

Answer:

Sequential Operations: Suppose we want to switch on the LED, fan and a PC. We can do it one by one and in a sequence. And it means step by step in a proper sequence, and that which is mentioned.

Conditional Operation: Suppose we are given a condition that if LED is switched on then you cannot switch on the PC. Such type is known as the conditional operation.

Iterative Operations: If you the number of times a given code is to be looped, or iterative, then we are dealing with the iterative operations.

In pseudo-code we represent them as:

Start

PC_State= Open

LED_State =Open

fan_State =Open

Stop

Condition Statement

If LED= Open

PC=Blocked

Iterative Statement:

For i =1 to 3

Open Device No <i>

And this way the three are different in everyday life, and hence in pseudocode.

Explanation:

Please check the answer section.