The Selection Construct

Sometimes we wish to change the order of processing based on certain conditions.

This can be accomplished by using a selection construct pictured below:

We will examine this in the following example:

Jim is a salesman for an auto car company. If his total sales for the week exceeds $10000 he is rewarded a sales commission of 8 percent of the sale, if not he is awarded no commission.

Create a flowchart algorithm which accepts the total sales and outputs the commission.

Exercise:

The problem is modified such that  if the total sales were less than $10000 he would receive a commission of 4 percent. See changes below:

Jim is a salesman for an auto car company. If his total sales for the week exceeds $10000 he is rewarded a sales commission of 8 percent of the total sales, if not he is awarded a commission of 4 percent.

Create a flowchart algorithm which accepts the total sales and outputs the commission.

Draw a flowchart for the modified scenario.

© 2020  Vedesh Kungebeharry. All rights reserved.