< Programming Fundamentals < Conditions
Programming Fundamentals/Conditions/Conditions
A condition performs different computations or actions depending on whether a programmer-specified Boolean condition evaluates to true or false.[1] This activity introduces conditions. This activity will help you understand how to use conditions in a program.
Objectives
- Understand condition concepts.
- Understand how conditions are specified in a program.
- Single-step through a program to observe condition execution.
Prerequisites
Learners should already be familiar with a visual programming environment.
Introduction

Flowgorithm conditions
Review the flowchart example on the right.
Questions
- What flowcharting symbol is used to indicate a condition?
- How are conditions structured?
Activity
With a partner, perform the following:
- Using a visual programming language, create a program matching the flowchart on the right.
- Save the program.
- Test the program to verify that it works correctly.
- Trade places, so that both partners have an opportunity to "drive" the visual programming environment.
- Change the environment to use a slow run speed and/or step through the program one shape at a time.
- Working together, create a list of function names that would be used to follow the input-process-output model and either convert Fahrenheit temperature to Celsius or convert Celsius temperature to Fahrenheit, depending on user choice.
Applications
- Identify specific steps which must be followed when creating a program using conditions.
- Discuss your activity experience with your classmates. What surprised you? What have you learned that you can apply to your own school or work environment?
References
This article is issued from Wikiversity. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.