Programming Flashcards
What is the difference between a character and a string?
A character is one character, string can be multiple characters long
What is declaration?
Creation of a variable
What concept uses an IF statement?
selection
What is meant by a nested IF statement?
If statements inside if statements
Why should you use meaningful identifier names?
easier to read
easier to debug
less need for comments
What is self-documenting code?
code which is written in such a way as to be easy
to read and understand by other programmers
without the need for extra documentation
What 4 components make up a variable?
Memory address, identifier, data type, value
What is an identifier for a variable?
How the variable is referred to in the code
What is meant by concatenation?
Joining multiple strings together
Why should you use subroutines
less duplication of code only need to change or update code once easier to read easier to debug subroutines can be re-used in other programs workload can be split
What is the name of a subroutine that doesn’t return a value?
Procedure
What is the name of a subroutine that returns a value?
Function
What does the scope of a variable mean?
Visibility of a variable
What are the advantages of local variables?
uses less memory less likely to make assignment errors easier to debug identifier names can be re-used in other subroutines subroutines can be re-used elsewhere
What are the disadvantages of global variables?
uses more memory
more likely to make assignment errors
harder to debug
harder to come up with meaningful and unique identifier names
subroutines cannot be used in other programs