Programming Flashcards
What is a does a class consist of?
- Class name
- Attributes
- Methods
What are the advatnages of OOP?
- Written in modules meaning easy debugging
- Easy to add new fuctionality with additional modules
- Programmers can work in thier own self contained modules
- Objects can inherit attributes and behaviours meaning reusable code
What is a class?
- A blueprint defines a realted group of things
- Properties and methods
- Doesnt store data
What are objects?
- Created from a class
- Defined in an istance of a class
- Same properties and methods from the origin class
What is inheritence?
- Where a class can inherit another class
- Sharing the properties and methods of another class
- ‘Is a ‘ relationship (Animal is a cat)
What is polymorphism?
- Where objects are processed differently depending on their class
What is overriding?
- Overridden method has the same method in the inherited class but a different implementation
What is association?
- Where objects can have a ‘has a’ relationship
- ‘Teacher has a student’
- Can be aggression or composition association
What is aggregation?
- The weaker type of association
- When an object is associated with another aggression, it will still exist if its containing object is destroyed
What is compostion?
- Stronger relationship between classes
- Where if the containing object is destroyed so is the associated object
What are the needs for data types?
- Allows for delcleration of data type
- Which allows for the appropriate amount of data to be set aside
What are the diferent data types you need to know?
- Integer
- Real float
- String
- Character
- Date/Time
- Boolean
- Records
- Arrays / Lists
- Pointer / Reference
What is the integer used for and give an example?
- Stores positive and negative whole numbers
- 10, -19
What is real / float used for?
- Extension of integer
- Stores fractions and decimals
What are records?
A collection of related different data types
What are arrays used for?
- Fixed size
- Sequential set of elements of the same data type
What are pointers and what are they used for?
Declare a variable that will allow you to point to a physcial address in memory
What are user defined data types?
- Complex data types
- Based on in-built data types provided by the langague
- As built in data types can be limiting
What are the programming constructs?
- Sequence
- Selection
- Iteration
What is the sequence construct?
- One statment after the other in order
What is the selection construct?
Do a set of statment based on a condition to allow your code (if statments)
What is the iteration construct?
Do a set of statments again and again a known fixed number of times
What is a subroutine?
- Self contained set of commands which can be called from different parts of a program
- Reduces repetition
- Either procedures or functions (functions return values)
What is an identifier?
- Name an entity within the language
- Used to name constants, types, classes, etc
What are constants?
- NAme used to refer to a fixed value
- Value set when the code is written
- Cannot be changed while the program is running
What is a variable?
- Name that refers to a particular memory location
- That stores data
- Value of data is not known when program is written
- Can only change when program is running