Software Development: High Level Programming Language Constructs Flashcards

1
Q

What is a variable?

A

It is the name that a program uses to identify the location that is storing an item of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an integer variable?

A

A variable that stores a positive or negative whole number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a real variable?

A

A variable that stores fractional numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Boolean variable?

A

A variable that stores only two values, either True or False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a character (char) variable?

A

A variable that stores a single character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a string variable?

A

A variable that stores a sequence of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a 1-D array?

A

A One Dimensional Array is used to manipulate a group of data more easily than using independent variable names for each item of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What 3 things must be specified when declaring an array?

A
  • A name for the array
  • A data type for the array
  • The size of the array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

State two characteristics of a 1-D array

A
  • It stores a list of values with the same data type

* It has a fixed number of values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can using an array be faster that using several variables when creating a program? (2)

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

State 2 string operations

A
  • Concatenation

* Substrings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is ‘Concatenation’?

A

This is when you join string variables together to make longer strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are substrings?

A

When you use Left, Right and Mid functions to return part of a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Name 2 ways you could format inputs and outputs in VB

A
  • Text Box

* Message Box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

State a multiple outcome selection

A

Select CASE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a Local variable?

A

A variable that only exists within the subroutine in which it is declared

17
Q

What is a Global variable?

A

A variable that is recognised by all the subroutines in a program, and can be changed by any of these subroutines

18
Q

What is the scope of a local variable?

A

One subroutine

19
Q

What is the scope of a global variable?

A

The entire program

20
Q

State 2 types of subprograms

A
  • Procedures

* Functions

21
Q

What is a Procedure?

A

A subprogram that can return any number of values

22
Q

What is a Function?

A

A subprogram that can only return one value

23
Q

What is a parameter?

A

A parameter is a variable or value that is passed into or out of a subroutine

24
Q

What is an Actual parameter?

A

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)

25
Q

What is a Formal parameter?

A

It is a parameter that is used in a subroutine definition (In the Call bit)

26
Q

What is an In parameter?

A

It passes the current value of a variable into a subprogram for use

27
Q

What is an Out parameter?

A

It passes the current value of a variable out of a subprogram for use

28
Q

What is meant by the term “By Reference”?

A

Passing parameters by reference is used when the value being passed in is to be updated and passed back out again

29
Q

What is meant by the term “By Value”?

A

Passing parameters by value is used when the value being passed into a subroutine is not to be updated or passed back out again

30
Q

State 2 benefits of using parameter passing rather than global variables when programming

A
  • It makes data flow clearer, so improves maintainability and readability
  • It reduces impact on the main memory
31
Q

State why data flow should be included in an algorithm

A

Data flow identifies the data to be used by sub processes

32
Q

Explain why it is more efficient to pass an array by reference than by value? (2)

A
  • Doing this uses up less processor time.

* This is because it does not require making a second copy of an array