Basic Control Flow

Experiment Part I: Position of Point w.r.t to a Rectangle
Here we shall see how the problem of determining whether a given point is inside or outside a rectangle can be solved using various conditional constructs.

  1. Initialize the values of the variables on the top left. X and Y denote the x and y coordinate of the input point.
  2. Select the code prototype with which you would like to solve the problem.
  3. Click start to begin the expriment.
  4. Click Next to get a step by step execution of the code along with the reasoning which is displayed on the right hand side panel.

Experiment Part II: Selecting the Day of a week
Here we shall see how a switching construct works by associating one number to each of the days.

  1. First, select a day from the top left by clicking on the correspoding radio button or enter any number in the textbox directly. Then, click on SUBMIT.
  2. Select the code prototype with which you would like to solve the problem.
  3. Click on the activated START button to begin the experiment.
  4. Click Next to get a step by step execution of the code. The changes in local variables can be visualized on the bottom left of the screen. The OUTPUT can be visualized on the right part of the screen.

Procedure

Here you will do two experiments. First will be on finding whether a point is inside or outside rectangle. Secondly you will see a program for selecting a day in the week using switch construct.