Principles of Programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Define a Boolean value in Backus-Naur form

A

<Boolean> ::= "True" | "False"
</Boolean>

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

Define the primary colours in Backus-Naur form

A

<PrimaryColours> ::= "red" | "yellow" | "blue"
</PrimaryColours>

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

Define the seasons of the year in Backus-Naur form

A

<Seasons> ::= "Spring" | "Summer" | "Autumn" | "Winter"
</Seasons>

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

Define the digits(0-9), both

A

<Digits> ::= [0-9]
or
<Digits> ::= "0" | "1" | "2" | ...
</Digits></Digits>

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

Define a Programming paradigm

A

It is an approach to solve problems by using programming languages

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

Name four common programming paradigms

A

Procedural/Imperative
Object-Oriented
Declarative
Functional

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

Describe Procedural/Imperative

A

A program that can be split into procedures or subroutines

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

Describe Object-Orientated

A

Classes are used to define objects in order to model the problem to be solved

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

Describe Declarative Languages

A

Use commands to set the goal and all outcomes for a task, doesn’t involve code, or instructions on how to complete the task

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

Describe Functional Languages

A

Emphasizes the composition of functions and the avoidance of side effects

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

Define a Class

A

A blueprint or template for creating objects

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

What are attributes in relation to OOP

A

Attributes are the data members of a class.
They represent the characteristics or properties of objects created from the class

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

What are Methods in relation to OOP

A

Methods are the functions defined within a class. They define the behavior/actions that objects created from the class can perform

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

What do methods operate on

A

The class’s attributes

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

What are objects in relation to OOP

A

An object is an instance of a class, it is an entity created based on the class blueprint.

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

What do objects have in OOP

A

Attribute Values and methods to perform actions

17
Q

What is encapsulation in relation to OOP

A

A fundamental principle of OOP where the class encapsulates its attributes and methods

18
Q

What is inheritance in relation to OOP

A

A mechanism that allows a class to inherit attributes and methods from another class

19
Q

What does do Polymorphism in relation to OOP

A

Allows objects of different classes to be treated as objects of a common base class

20
Q
A