Software Development: High Level Programming Language Constructs Flashcards
What is a variable?
It is the name that a program uses to identify the location that is storing an item of data
What is an integer variable?
A variable that stores a positive or negative whole number
What is a real variable?
A variable that stores fractional numbers
What is a Boolean variable?
A variable that stores only two values, either True or False
What is a character (char) variable?
A variable that stores a single character
What is a string variable?
A variable that stores a sequence of characters
What is a 1-D array?
A One Dimensional Array is used to manipulate a group of data more easily than using independent variable names for each item of data
What 3 things must be specified when declaring an array?
- A name for the array
- A data type for the array
- The size of the array
State two characteristics of a 1-D array
- It stores a list of values with the same data type
* It has a fixed number of values
How can using an array be faster that using several variables when creating a program? (2)
- You don’t need to write a line of code to manipulate each data item individually
- An operation can be performed on each item in the array using a loop
State 2 string operations
- Concatenation
* Substrings
What is ‘Concatenation’?
This is when you join string variables together to make longer strings
What are substrings?
When you use Left, Right and Mid functions to return part of a string.
Name 2 ways you could format inputs and outputs in VB
- Text Box
* Message Box
State a multiple outcome selection
Select CASE
What is a Local variable?
A variable that only exists within the subroutine in which it is declared
What is a Global variable?
A variable that is recognised by all the subroutines in a program, and can be changed by any of these subroutines
What is the scope of a local variable?
One subroutine
What is the scope of a global variable?
The entire program
State 2 types of subprograms
- Procedures
* Functions
What is a Procedure?
A subprogram that can return any number of values
What is a Function?
A subprogram that can only return one value
What is a parameter?
A parameter is a variable or value that is passed into or out of a subroutine
What is an Actual parameter?
It is a parameter that is passed into a subroutine when it is called from another part of the program (In the Public Sub bit)
What is a Formal parameter?
It is a parameter that is used in a subroutine definition (In the Call bit)
What is an In parameter?
It passes the current value of a variable into a subprogram for use
What is an Out parameter?
It passes the current value of a variable out of a subprogram for use
What is meant by the term “By Reference”?
Passing parameters by reference is used when the value being passed in is to be updated and passed back out again
What is meant by the term “By Value”?
Passing parameters by value is used when the value being passed into a subroutine is not to be updated or passed back out again
State 2 benefits of using parameter passing rather than global variables when programming
- It makes data flow clearer, so improves maintainability and readability
- It reduces impact on the main memory
State why data flow should be included in an algorithm
Data flow identifies the data to be used by sub processes
Explain why it is more efficient to pass an array by reference than by value? (2)
- Doing this uses up less processor time.
* This is because it does not require making a second copy of an array