7. Programming (3) Flashcards
Is button bounce an issue for a light switch?
No, the light will just light up or not and bounce won’t effect the overall result.
When would button bounce be an issue?
When the button is used for setting a program on a system. At each press the machine toggles to the next available program. Button bounce will be an issue because we don’t want the system advancing a random number of programs each time the button is pressed.
What does a rounded rectangle mean?
Beginning or end of a process
What does a rectangle mean?
A generic program step
What does a parallelogram represent?
An input/output
What does a diamond mean?
A decision. This will have two arrows coming from it: one for yes and one for no.
What does a rectangle with double vertical edges represent?
Subroutines
What do arrows show?
Direction of flow
What are the steps towards writing a program?
- Establish/write down the requirements
- Use a flowchart to show how the requirements can be met
- Then you are ready to start writing code
What is an initialization block?
The beginning of the flow chart: start -> set initial states
What is the main loop?
The main loop is where all of the main requirements are met
How is a decision step written in C?
Using the if statement: if(condition) { // things to do if true } else { // things to do if false } Where the 'else' part is optional.
What does == do?
tests for equality
what does != do?
tests for inequality
what does > do?
tests for greater than