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
Reusability
Reusability is the practice of using existing code/anything in programming for a new function or software, this helps development goal of achieving high speed, low cost and quality.
What is event driven programming?
Is the idea that blocks of code are defined and executed only in response to a specific event being raised such as the code is waiting for a mouse click so it can run the code is supposed to when the mouse click happens.
Event driven programming
Event driven programming, registers the events needed and you say what block of code should run when that event occurs, and with event driven programming you don’t have to do any state validation because is already doing it for you.
What is an event handler?
Event handler is the block of code that is intended to run in response to an event. e.g you want a message to appear when a button is clicked, the button being clicked is the event and the event handler is the code that makes the message appear.
What is an Event Loop?
Event loop is a queue data structure and is used to monitor the events the program must respond to, constantly runs waiting for the predefined event to be triggered, also it uses some CPU processing time even when the program is not actively being used.
What is service oriented processing?
Service oriented processing refers to background software programs running on a system that are awoken by events, it allows programs to be linked to particular services that may run in the background, however linking a program to a service that runs on the background will use up system processing time and memory because is constantly checking if something happens.
What is time driven?
Time-driven means that the system is sensitive to time, it allows functions in a program to be scheduled, to activate at particular times or at particular intervals also allows the programmer to add functions that do not need to be monitored by the user.
What is trigger function?
Trigger functions are designed to assign a particular event with an action/code
What is translation in programming?
Translation in programming is translating code between programming languages.
What are the reasons for translation?
Because languages do not last forever, for example if you have code written in a language that is no longer supported what happens as hardware evolves and also does technology, your old language will not be able to support new features, also another reason is to consolidate the languages used, if you have a business and you buy your rival’s business everything must be in the same language and Personnel.
What are the benefits of translation?
If all software within an organisation is written using the same language, it helps with efficiency. Translating from a less pop to a more pop language will increase the availability of support. It can support new hardware
What are the drawbacks of translation?
Time investment
Testing
Knowledge requirements - someone good on both languages that can translate it
Not every language has the same features.
Why programmers use functions?
Because it can be reused once you’ve defined a function you can use it over and over again.
Also because it helps reduce the complexity of the code if you had to write a function every single time.
What is the structure and features of event driven programming
Structure: Sub-routines Call function Main Loop Features: Event Event Loop Event Handler Time Driven System oriented processing Trigger Functions
What is the structure and features of object oriented programming?
Structure: Class Objects Features: Inheritance Encapsulation Polymorphism and Overloading Data Hiding Reusability
What is the structure and features of procedural programming?
Structure: Sequence Selection Iteration Features: Statements Blocks Procedures Functions