Advanced Control Flow

Procedure for the experiment is as follows.

Experiment 1:

  • Choose experiment type by pressing the "Switch experiment" button on the bottom left.
  • Select the looping construct with which you want to solve the problem.
  • Enter the number for which factorial has to be calculated and press OK.
  • Press Start to start the experiment.
  • Click Next to get a step by step execution of the code.

Experiment 2:

  • Choose experiment type by pressing the "Switch experiment" button on the bottom left.
  • Enter the height of pyramid and press OK.
  • Press Start to start the experiment.
  • Click Next to get a step by step execution of the code.

Manual

Here we shall see how various looping constructs can be used to find the factorial of a positive integer.

In the other part of the experiment, we shall see how nesting of loops can be done to create a pattern of any size that looks like a pyramid.