Topic 1.4 - Principles of Programing Flashcards

1
Q

What is a procedural language?

A

This is a language that uses defined sub-routines, functions and procedures to describe to the computer how to do something.
- Obey ordered instructions

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

What is a non-procedural language?

A

This is a language that gives orders in the form of queries which then return facts.
- eg querying a database

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

What is an event driven language?

A
  • Used with a GUI

- User’s inputs create events which are handled by event handlers

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

What is a visual language?

A
  • Often used to teach programming

- eg Scratch

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

What is a mark-up language?

A
  • Describes how content it laid out on a web page and how to handle interactive event
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a class?

A

A class is a set of objects which share a common data structure and common behaviour.

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

What is a class definition?

A

A template that can be used to create objects

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

What is an object?

A

It is an instance of a class

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

What are attributes?

A

These are characteristics and fields of an object

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

What are methods?

A

These are the procedures and functions carried out by the object

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

What is encapsulation?

A

The idea that objects should contain all the methods and attributes that they need

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

What is instantiation?

A

This is the concept of an object being based on a class

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

What is polymorphism?

A

The same name is used in the class hierarchy for a method but each class may implement this differently.

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

What is inheritance?

A

Enables new objects to take on the properties of existing objects

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

What is a superclass?

A

A superclass is used as the basis for inheritance

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

Give a BNF definition for a capital letter followed by a unspecified amount of numbers

A

::= 0|1|2|…|8|9
::= |
::= A|B|C|…|Y|Z
<code> ::= </code>

17
Q

What are the benefits of OOP?

A

Reliable - More likely to be designed correctly and extensively tested
Time saving - Reusing existing components means less code to write/test
Data Protection - Only accessed in well defined ways