F453 - high level programming paradigms Flashcards
Explain backtracking
after finding a solution (to a goal) go back and follow an alternative path… …to attempt to find another solution
What is the need for BNF?
to unambiguously define the syntax of a computer language
Why is UML used?
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
Describe the features of a procedural language
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
Explain the term inheritence
a class has all the attributes and operations of its superclass… …and may also have attributes & operations of its own
What is an object?
an instance of a class a real-world entity holds attributes and methods
What is a class?
a template for… …a set of objects… …that have state and behaviour
Look at image
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
Look at image
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.)
Dr Connor is a doctor at the health centre. From the image, describe why his attributes include surname but not include hourlyRate.
) 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
Use the image, to explain the terms object and class
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
Cleaning staff should be included in the class diagram. A cleaner needs attributes hoursWorked() and operation getHours(). Show this information in a class diagram.