1.4 Programming Flashcards
Class definition
A class is a set of objects which share a common data structure and current behaviour. It is the template that can be used to create objects
An object definition
An object is an instance of a class when they’re being used
Instantiation definition
Is it the concept of an object to being based on a class
Encapsulation definition
Objects should contain within themselves everything I need including all the attributes and methods
Polymorphism definition
The same name is used in the class hierarchy for a method but each class may implement this method to differently
Inheritance definition
Enables new objects to take on the properties of existing objects Super class is used as the basis for inheritance
Subclass
Is that in Heritance from a super class is called asset class. Inheritance in different relationships between classes and organises classes into groups
State the purpose of Backus-Naur form (BNF
BNF is used to describe (unambiguously) the syntax/grammar of a programming/computer language.
why Backus-Naur Form (BNF) is preferable to ordinary English or Welsh when defining the syntax of a computer language
It is unambiguous
Explain the difference between a procedural and non-procedural programming language
Procedural languages are concerned with carrying out an ordered set of instructions
Non-procedural languages are to do with facts / rules / queries
4GL
· used in (e.g.) a relational database system as a query / manipulation language
Why:
· aimed at end-users / relatively close to natural language / requires less programming skill.
Visual Language
· used for production of objects / buttons / icons / GUI / Windows / graphics content / event driven environment.
Why:
· may be easier to learn / more intuitive because visual / good help / tools available
State when a scripting language might be used
A scripting language is often embedded in other languages and can add functionality to web pages
Explain why careful version control is necessary when developing computer programs
· If programmer A modifies current version, and programmer B modifies an earlier version, neither new version will contain both modifications
· Any amendments must be made to the most recent versions.
Explain the role of a break point when debugging a program
Break point: allows the programmer temporarily to halt execution in order to ascertain the value of variables at that point
Explain the role of a variable watch when debugging a program
Variable watch: lists the value of a variable at specific points during the execution.
Explain the role of a store dump when debugging a program
Store dump: lists the entire contents of memory at a specific point.
Explain what is meant by the term parallel processing
Parallel processing is the simultaneous use of several processors / cores to perform a single task.
give an example of an application where parallel processing might be useful.
PP could be useful in (for instance) weather forecasting or image processing
Discuss the nature of different programming paradigms
13 marks
Procedural languages
· Procedural languages are used in traditional programming based on algorithms or a logical step by- step process for solving a problem
· Allows tight control over the underlying operation of the hardware
Scripting Language
· Set of commands understood by the applications software
· Usually embedded in another language and is used to control aspects of the software
Non-Procedural languages
· Non-procedural programming languages allow programmers to specify the results they want without specifying how to solve the problem
· Non-procedural languages are to do with rules / making queries
Object Orientated Language
· Uses objects and classes - include both data and associated processing
· Applies the principles of encapsulation, inheritance and polymorphism to aid programming
Special Purpose Language
· Languages that were designed with a specific purpose in mind as opposed to a more general use language
· Might have essential / helpful features relevant to the application
4th Generation Language
· First generation programming languages created construct above the machine-code program
· Each subsequent generation represented a further distancing from the binary code that the computer hardware actually reads
Natural Languages
· The user would not need to structure voice (or typed) input in any way - could communicate with the computer as if with another person
· A natural language interface would need very high processing power / very complex software
Visual Programming Languages
· High level programming language
· Particularly suitable for production of objects / buttons/ icons, etc.
Application packages that have programming
capabilities
· Additional functionality can be added without a programmer / buying another package / program
· Can customise the package / tailor to specific needs etc