CSC 171 - Introduction to Computer Programming

Lab Assignment #4 - Flowcharts and Pseudocode for Decisions

Due Tuesday, September 12, 2023

if and if-else both use a decision to determine what will happen next:

if x == 0:
        print("x is zero")


        if x > 0:
        print("Positive")
        else:
        print("Non-positive")

We show a decision in a flow chart using the symbol:

Consider the flowchart:

The pseudocode would be:


IF x is greater than 0
   THEN print "Positive"
   ELSE print "Non-positive"
 

In this assignment, you will:

[Back to the Lab Assignment List]