Topic 1: Fundamentals of programming Flashcards

1
Q

What is inheritance?

A

Inheritance allows one class to share the properties and method of another class, while having its own properties and methods too

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

What are the names given to the class being inherited and the inheriting class?

A

The class being inherited from- Superclass
The class that is inheriting - Subclass

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

What is overriding?

A

An overriding method has the same name method as a method in an inherited class but different implementation

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

Integer

A

A whole number, positive or negative, including zero

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

Real/float

A

A positive or negative number which can have a fractional part

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

Boolean

A

A value which is either true or false

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

Character

A

A single number, letter or symbol

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

String

A

A collection of characters

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

Data/Time

A

A way of storing a point in time, many different formats are used

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

Pointer/ Reference

A

A way of storing memory addresses

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

Records

A

A collection of fields, each of which could have a different data type. You can think of a record as a row from a table

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

Arrays

A

A finite indexed set of related elements each of which has the same data type

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

Variable decleration

A

Creating a variable for the first time, giving it a name and sometimes a data type

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

Constant decleration

A

Creating a constant a constant for the first time, giving it a name and sometimes a data type(the value doesn’t change when the program is running)

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

Assignment

A

Giving a constant or variable a value

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

Iteration

A

Repeating an instruction, this could be definite or indefinite

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

Selection

A

Comparing values and choosing an action based on those values

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

Subroutine

A

A self contained set of commands that can be called from different parts of a program

19
Q

Definite iteration

A

A type of iteration in which the number of repetitions required is known before the loop starts

20
Q

Indefinite iteration

A

The number of repetitions is not known before the loop starts, the loop terminates when the conditions are met

21
Q

Nested structures

A

This is when one structure is placed within another.

22
Q

What is volatility

A

Data which is not stored permanently and will therefore be lost should the program crash

23
Q

Parameters

A

These are used to pass data between subroutines within programs, (specified within brackets)

24
Q

Argument

A

The actual value passed by a parameter

25
Function
A subroutine that always returns a value
26
Local variables
Declared and used inside a subroutine, only available to that routine. Created when routine is called and destroyed when it ends
27
Global variables
Declared at the top of a program outside of subroutines. Usable throughout the program, created when program starts and destroyed when it ends
28
Selection
Do a set of statements based on a condition
29
Iteration
Do a set of statements again and again
30
Definite itereation
Do a set of statements again and again a known number of times
31
Indefinite iteration
Do a statement again and again until a condition is met
32
Difference between a procedure or function
Both procedures and functions take parameters and carries out a set of tasks whilst a function returns a value
33
Identifier
a name used to identify an entity in a program
34
Variable
A name used to refer to a particular memory location that is used to store data
35
Constant
A name used to refer to a fixed value
36
Advantages of constants over variable
-Cannot accidently change constant -The program runs faster -If value needs to be changed at a later date you just change it once -Expressions using the value are much easier to understand if you choose an appropriate identifier
37
How do you generate a new random number in VB
Randomize() Rnd()
38
Procedure
A self contained set of commands that can be called from different parts of the program
39
Function
A function is a sub-routine that may take one or more parameters and returns a value
40
Exception handling
As a programmer you should try to anticipate possible errors and write code to deal with them
41
How do you do exception handling in VB.net?
try ... catch .... end try
42
Recursion
A subroutine which calls itself
43
The key characteristics of recursive algorithms (3 points)
Must contain a stopping condition(base case) For any input values other than the stopping condition the routine must call itself The stopping condition must be reachable after a finite number of times
44
Is recursion better than iteration?
No as recursion isn't very efficient on memory