F453 - high level programming paradigms Flashcards

1
Q

Explain backtracking

A

after finding a solution (to a goal) go back and follow an alternative path… …to attempt to find another solution

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

What is the need for BNF?

A

to unambiguously define the syntax of a computer language

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

Why is UML used?

A

a standard way to present (information)… …the design of a system… …which is visual, so easy to understand allows systems analysts, programmers and clients to communicate makes system maintenance easier… …when modifying a system

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

Describe the features of a procedural language

A

imperative language uses sequence, selection; iteration program states what to do… … & how to do it program statements are in blocks each block is a procedure or function logic of program is given as a series of procedure calls

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

Explain the term inheritence

A

a class has all the attributes and operations of its superclass…  …and may also have attributes & operations of its own

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

What is an object?

A

 an instance of a class  a real-world entity  holds attributes and methods

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

What is a class?

A

 a template for…  …a set of objects…  …that have state and behaviour

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

Look at image

A

 identifierA must include 1 or more letters

 identifierB need not include any letters

 eg $2 is valid for identifierB but not for identifierA…

 …while $2ab is valid for both

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

Look at image

A

 a class has all the attributes and operations of its superclass…

 …and may also have attributes & operations of its own

 eg an object of class Nurse has surname from StaffMember …

 …in addition to daysWorked (accept other valid examples from diagram.)

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

Dr Connor is a doctor at the health centre. From the image, describe why his attributes include surname but not include hourlyRate.

A

)  Dr Connor is an instance of Doctor

 surname is inherited from StaffMember

 hourlyRate is an attribute of Receptionist…/hourlyRate is not an attribute of Doctor or of StaffMember

 …which is not a superclass for Doctor

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

Use the image, to explain the terms object and class

A

object:

 an instance of a class  a real-world entity

 holds attributes and methods

 eg oneCleaner / Mrs Jones

class:

a template for…  …a set of objects…

 …that have state and behaviour

 eg Cleaner/StaffMember/Doctor/Nurse/Receptionist

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

Cleaning staff should be included in the class diagram. A cleaner needs attributes hoursWorked() and operation getHours(). Show this information in a class diagram.

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