Programming Fundamentals Flashcards
What are the 3 constructs
sequence, selection and iteration
What is difference between local and global variables
Local: declared with a specific subroutine
Global: can be used at any point within the whole program
What are two advantages of using local variables
Saves memory when it is needed
Easier to debug local variables
What are two advantages of using global variables
Makes maintenance easier
Can be used
What is a constant
Data that does not change in value
List the 5 data types and give examples for each
Character: a single character
String: a sequence of characters
Integer: a whole number
Real: a decimal
Boolean: only has two possible values
What is casting
Converts the value of a variable from one data type to another