Creating algorithms unit 1 Flashcards
(10 cards)
What are the three main programming constructs used in algorithms?
Sequence, Selection, and Iteration.
What is the sequence construct?
It means the instructions are executed in the exact order they are written.
What is the selection construct?
It allows decision-making in algorithms, using conditions to choose different paths (e.g., IF…ELSE statements).
What is the iteration construct?
It repeats steps using loops (e.g., FOR, WHILE) until a condition is met.
Why are sequence, selection, and iteration important?
They are the basic building blocks of all algorithms.
What is the first step in creating an algorithm to solve a problem?
Understand the problem and break it down into smaller steps.
What are the different ways to represent an algorithm?
Flowchart, pseudocode, written description, or draft program code.
What is a flowchart used for in algorithms?
To visually show the steps and logic of an algorithm using symbols and arrows.
What is pseudocode useful for?
Describing the logic of an algorithm in a clear, readable, code-like way.
What is a draft program code?
A rough version of the actual code, used to test and build the algorithm in a real programming language.