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:
- Do the flowchart AND pseudocode for a Python program that reads in a temperature in Fahrenheit and then prints “Freezing” is the temperature is below or equal to 32 and “Balmy” if it isn’t.
- Then write the program
[Back to the Lab Assignment List]