66.5k views
1 vote
Write the execution steps if the input is a lion.

Write the execution steps if the input is a elephant.

Indicate each element of the flowchart by putting "i" for input, "o" for output, "d" for decision in the circles provided next to the boxes.

Put a rectangle around the decision structure.

Write the execution steps if the input is a lion. Write the execution steps if the-example-1
User Dilraj
by
5.5k points

1 Answer

3 votes

Step-by-step explanation:

Execution step:

1. Starting the program

2. It will get the animal name

3. Check whether the animal eats only plants. Then it prints "Herbivore". If the condition is false, it prints "carnivore".

4. Stop the program

To identify input, output and decision:

Start and Stop (oval): These are neither input nor output

Does it eat only plants?: Decision making statement ("d")

Read the names of the animals(Parallelogram): Input ("i")

Print Herbivore, Print Carnivore: Output "o"

Scenario 1: Input is lion

1. Start

2. Reads the input as "lion"

3. Check if lion eats only plants. So here it is false

4. Print "Carnivore"

5. Stop

Scenario 1: Input is Elephant

1. Start

2. Reads the input as "Elephant"

3. Check if lion eats only plants. So here it is true

4. Print "Herbivore"

5. Stop

User Ifeegoo
by
5.2k points