Unit 1 Frankie Flashcards
What is procedural programming
Procedural programming is a code that makes use of statements, blocks, procedures and functions
What is a statement?
Statement is a single instruction, that performs a specific small task.
What are blocks?
A block of code is a group of statements that are intended to execute in order
What is procedures?
A procedure processes data, but does not return a value to the code from where it was called.
Functions
A function is a block of code that does return a value when it has been completed when is called.
What are the structures in procedural programming?
Sequence
Conditional / selection
Iterative / iteration
What is a sequence?
When there isn’t any other instruction, statements are executed in sequence, in the order in which they are written.
What is a conditional/selection?
Condition is more flexible than sequence, it allows a condition to be evaluated to determine whether or not blocks of code should be executed and it could be done by IF statements.
What is Iterative/Iteration?
These are loops, commands such as while or for and it controls the flow of execution.
What is object oriented programming?
Object Oriented programming is about creating objects that contain both data and functions
What are the features of OOP?
Inheritance Encapsulation Polymorphism and overloading Data hiding Reusability
What is inheritance
New classes can be defined that inherit from an existing class, the new classes automatically start with the parent class’s attributes and methods, the new child can then add extra attributes or methods as required.
What is encapsulation?
Encapsulation refers to the process of bundling both the data and the methods that apply to an object into one unit. ( making one class with loads of different variables and functions.)
What is polymorphism and overloading?
Polymorphism allows you to create multiple versions of the same method. Overloading is the process of being able to define the same method or function multiple times, with each having different parameters.
Data hiding
Data hiding is used to guarantee that data is always validated ( if appropriate) and is basically making classes and any other data private so no one can access it if is not public