Docsity

OCR A Level Computer Science - Types of Programming Language, Exams of Applications of Computer Sciences

Toggle sidebar
bg1
OCR A Level Computer
Science: 1.2.4 - Types of
Programming Language
Addressing mode - ANSSpecifies how the operand should be interpreted
Addressing modes allow - ANSfor a greater number of locations for data to be
stored
Advantages of OOP - ANS- Reusable (inheritance and polymorphism)
- Classes can be used across multiple projects
- Encapsulation
- Easy to maintain and update (modular structure)
- Advanced planning and thorough design = higher-quality software with
fewer vulnerabilities
- Abstraction
Behaviour - ANSMethods associated with a class, which describe the actions
it can perform
Class - ANSTemplate for an object and defines the state and behaviour of an
object
Common uses of declarative programming - ANSExpert systems and artificial
intelligence
pf3
pf4
pf5

Partial preview of the text

Download OCR A Level Computer Science - Types of Programming Language and more Exams Applications of Computer Sciences in PDF only on Docsity!

OCR A Level Computer

Science: 1.2.4 - Types of

Programming Language

Addressing mode - ANSSpecifies how the operand should be interpreted Addressing modes allow - ANSfor a greater number of locations for data to be stored Advantages of OOP - ANS- Reusable (inheritance and polymorphism)

  • Classes can be used across multiple projects
  • Encapsulation
  • Easy to maintain and update (modular structure)
  • Advanced planning and thorough design = higher-quality software with fewer vulnerabilities
  • Abstraction Behaviour - ANSMethods associated with a class, which describe the actions it can perform Class - ANSTemplate for an object and defines the state and behaviour of an object Common uses of declarative programming - ANSExpert systems and artificial intelligence

Contructor - ANSAllows a new object to be created Declarative - ANSFocuses on stating the desired result and how it is obtained are abstracted from the user Direct Addressing - ANSGives the address which holds the value upon which the instruction is to be performed Direct addressing use - ANSLMC Disadvantages of OOP - ANS- Requires an alternative style of thinking so can be difficult

  • Not suited to all types of problems
  • Unsuitable for smaller problems Encapsulation - ANSAttributes declared as private so can only be altered by public methods Encapsulation purpose - ANSMakes code more reliable by protecting attributes Functional - ANSReuses a set of functions, program is lines of function calls, often combined within each other. Linked to maths. Functional examples - ANSHaskell, C#, Java Getter - ANSMethod which retrieves the value of a given attribute

Object-oriented - ANSBuilt on obects formed from classes that have certain attributes and methods. Programs are reusable and easy to update and maintain. Offset necessity - ANSUsed in indexed adressing to access data stored continguously in memory such as in arrays OOP examples - ANSPython, Delphi, Java Overloading - ANSA category of polymorphism that passes in different parameters into a method Overriding - ANSA category of polymorphism that redefines a method and alters the code so it functions differently and produces a different output Polymorphism - ANSObjects can behave differently depending on their class Polymorphism results in... - ANSthe same method producing different outputs depending on the object Problems procedural programming is suited to - ANSProblems that cna be easily expressed as a series of instructions Procedural - ANSA type of imperative programming that uses a sequence of instructions. Can be applied to a wide range of problems, easy to write and interpret. Procedural examples - ANSPascal, Python, Logo

Programming Paradigm - ANSDifferent approaches to using a programming language to solve a problem Recursion - ANSFunctions are expressed in terms of themselves until a certain condition known as a base case is met Selection - ANSA certain block of code is run if a specific condition is met Sequence - ANSCode executed line-by-line Setter - ANSMethod that sets the value of a particular attribute State - ANSGiven by attributes which give an object's properties Structured programming structures - ANSSequence, selection, iteration, recursion Subclass properties - ANSWill have all methods and attributes of the superclass. Can have its own additional properties Use of getters and setters - ANSSo attributes cannot be directly accessed and edited by users