Prelim - Ch. 5 - Software Solutions Flashcards
Give an example of an event driven language and explain how it works.
Visual Basic is an event driven language where subroutines are executed in response to a certain event occurring.
For example, hitting a command button causes the execution of a subroutine attached to that command button’s ‘click event’.
What has to happen before a variable can be used within program code?
It must be defined and declared. This means giving the variable:
• a name (identifier)
• describing its data type/ data structure
What is an identifier?
A name given to a variable, subroutine, or function. It must start with a letter, and is normally comprised of letters, digits and an underscore.
What are assignment statements?
Assignment statements are used to set the value of variables (and properties).
The result must have a compatible data type for the variable (str - str, int - int)
What is sequence?
Sequence is the control structure that ensures each process is executed in the correct order (in Visual Basic a new line does this). Event driven languages will have the largest number of possible sequences.
What do most languages use for selection?
If statements
What are the two types of repetition and how are they expressed?
Pre-test
While (condition)
Do something
End While
Post-test
Repeat something
Until (condition)
End Repeat