Programming Recap Flashcards
What is a variable?
A named memory location to hold a single value.
What is sequence?
Writing/following code in the correct order to solve a problem.
What is iteration?
Repeating code for a set number of times or until a condition occurs.
What is selection?
Choosing which code to execute based on a condition.
What is an assignment?
Adding a value to a variable.
What is a list?
A collection of data items with a single identifier.
What is a sub-routine?
Named, reusable sections of code, with or without parameters.
What are the three types of sub-routines?
- Procedures
- Methods
- Functions
What are the differences between the three types of sub-routines?
- Procedures don’t return a value
- Functions always return a value
- Methods are used in Object Oriented Programming
What is a file?
A way to store data between executions of a program. Can be read from or written to.
What are the 5 data types?
- String
- Real/float
- Integer
- Character
- Boolean
What is the difference between an input and an output?
Output - Displays anything relevant to the screen using the print statement
Input- Requests data from the user
What type of statements is used for selection?
- IF
- SWITCH/CASE
What types of statements are used for iteration?
- FOR
- WHILE
- DO UNTIL
What is the difference between FOR and WHILE loops?
For loops are used when you know how many times you want to repeat the code
While loops are used to repeat code until a condition occurs