Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 51

Higher Nationals

Internal verification of assessment decisions – BTEC (RQF)


INTERNAL VERIFICATION – ASSESSMENT DECISIONS
Programme title Higher National Diploma in Computing

Assessor Internal Verifier


Unit 1 Programming
Unit(s)

Assignment title

Student’s name
List which assessment criteria Pass Merit Distinction
the Assessor has awarded.

INTERNAL VERIFIER CHECKLIST

Do the assessment criteria awarded match


those shown in the assignment brief?
Y/N
Is the Pass/Merit/Distinction grade awarded
justified by the assessor’s comments on the Y/N
student work?
Has the work been assessed
accurately? Y/N

Is the feedback to the student:


Give details:
• Constructive?
• Linked to relevant assessment criteria?
Y/N
• Identifying opportunities for
Y/N
improved performance?
Y/N
• Agreeing actions?
Y/N
Does the assessment decision need
amending? Y/N

Assessor signature Date

Internal Verifier signature Date


Programme Leader signature (if required)
Date
Confirm action completed
Remedial action taken

Give details:

Assessor signature Date


Internal Verifier
signature Date

Programme Leader
signature (if required) Date
Higher Nationals - Summative Assignment Feedback Form
Student Name/ID
Unit Title Unit 1 Programming
Assignment Number Assessor
Date Received 1st
Submission Date submission
Date Received 2nd
Re-submission Date submission
Assessor Feedback:

LO1. Define basic algorithms to carry out an operation and outline the process of programming an application.

Pass, Merit & Distinction Descripts P1 P2 M1 D1

LO2. Explain the characteristics of procedural, object-orientated and event-driven programming

Pass, Merit & Distinction Descripts P3 M2 D2

LO3. Implement basic algorithms in code using an IDE.

Pass, Merit & Distinction Descripts P4 M3 D3

LO4. Determine the debugging process and explain the importance of a coding standard.
Pass, Merit & Distinction Descripts P5 P6 M4 D4

Grade: Assessor Signature: Date:


Resubmission Feedback:

Grade: Assessor Signature: Date:


Internal Verifier’s Comments:
Signature & Date:

* Please note that grade decisions are provisional. They are only confirmed once internal and external moderation has taken place and grades decisions have been agreed at the assessment board.

Assignment Feedback
Formative Feedback: Assessor to Student

Action Plan

Summative feedback
Feedback: Student to Assessor

Assessor signature Date

Student signature Date


Pearson Higher Nationals in
Computing
Unit 01: Programming
Assignment 01
General Guidelines

1. A Cover page or title page – You should always attach a title page to your assignment. Use previous page as your cover sheet and make sure all the details are
accurately filled.
2. Attach this brief as the first section of your assignment.
3. All the assignments should be prepared using a word processing software.
4. All the assignments should be printed on A4 sized papers. Use single side printing.
5. Allow 1” for top, bottom , right margins and 1.25” for the left margin of each page.

Word Processing Rules

1. The font size should be 12 point, and should be in the style of Time New Roman.
2. Use 1.5 line spacing. Left justify all paragraphs.
3. Ensure that all the headings are consistent in terms of the font size and font style.
4. Use footer function in the word processor to insert Your Name, Subject, Assignment No, and Page Number on each page. This is useful if individual sheets
become detached for any reason.
5. Use word processing application spell check and grammar check function to help editing your assignment.

Important Points:

1. It is strictly prohibited to use textboxes to add texts in the assignments, except for the compulsory information. eg: Figures, tables of comparison etc. Adding text
boxes in the body except for the before mentioned compulsory information will result in rejection of your work.
2. Carefully check the hand in date and the instructions given in the assignment. Late submissions will not be accepted.
3. Ensure that you give yourself enough time to complete the assignment by the due date.
4. Excuses of any nature will not be accepted for failure to hand in the work on time.
5. You must take responsibility for managing your own time effectively.
6. If you are unable to hand in your assignment on time and have valid reasons such as illness, you may apply (in writing) for an extension.
7. Failure to achieve at least PASS criteria will result in a REFERRAL grade .
8. Non-submission of work without valid reasons will lead to an automatic RE FERRAL. You will then be asked to complete an alternative assignment.
9. If you use other people’s work or ideas in your assignment, reference them properly using HARVARD referencing system to avoid plagiarism. You have to provide
both in-text citation and a reference list.
10. If you are proven to be guilty of plagiarism or any academic misconduct, your grade could be reduced to A REFERRAL or at worst you could be expelled from the
course
Student Declaration

I hereby, declare that I know what plagiarism entails, namely to use another’s work and to present it as my own without attributing the sources in the correct way. I
further understand what it means to copy another’s work.

1. I know that plagiarism is a punishable offence because it constitutes theft.


2. I understand the plagiarism and copying policy of the Edexcel UK.
3. I know what the consequences will be if I plagiaries or copy another’s work in any of the assignments for this program.
4. I declare therefore that all work presented by me for every aspects of my program, will be my own, and where I have made use of another’s work, I will attribute
the source in the correct way.
5. I acknowledge that the attachment of this document signed or not, constitutes a binding agreement between myself and Edexcel UK.
6. I understand that my assignment will not be considered as submitted if this document is not attached to the attached.

Student’s Signature: Date:


(Provide E-mail ID) (Provide Submission Date)
Higher National Diploma in Computing
Assignment Brief
Student Name /ID Number

Unit Number and Title Unit 01: Programming

Academic Year 2021/22

Unit Tutor

Assignment Title Design &Implement a GUI based system using a suitable


Integrated Development Environment

Issue Date

Submission Date

IV Name & Date

Submission Format

This submission will have 3 components

1. Written Report

This submission is in the form of an individual written report. This should be written in a concise, formal
business style using single spacing and font size 12. You are required to make use of headings, paragraphs
and subsections as appropriate, and all work must be supported with research and referenced using the
Harvard referencing system. Please also provide a bibliography using the Harvard referencing system. (The
recommended word count is 1,500–2,000 words for the report excluding annexures)

2. Implemented System (Software)


The student should submit a GUI based system developed using an IDE. The system should connect with a
backend database and should have at least 5 different forms and suitable functionality including insert,
edit and delete of main entities and transaction processing.

3. Presentation
With the submitted system student should do a presentation to demonstrate the system that was
developed. Time allocated is 10 to 15 min. Student may use 5 to 10 PowerPoint slides while doing the
presentation, but live demonstration of the system is required. Evaluator will also check the ability to
modify and debug the system using the IDE.

Unit Learning Outcomes:

LO1. Define basic algorithms to carry out an operation and outline the process of
programming an application.

LO2. Explain the characteristics of procedural, object-orientated and event-driven


programming.
LO3. Implement basic algorithms in code using an IDE.

LO4. Determine the debugging process and explain the importance of a coding
standard
Assignment Brief and Guidance:

Activity 1

A. The Fibonacci numbers are the numbers in the following integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence
relation. 
F n = F n-1 + F n-2

B. Factorial of a non-negative integer, is multiplication of all integers smaller than or equal


to n. For example, factorial of 6 is 6*5*4*3*2*1 which is 720.
n! = n * (n - 1) * …….. 1

Define what an algorithm is and outline the characteristics of a good algorithm.


Write the algorithms to display the Fibonacci series and the factorial value for a given
number using Pseudo code.
Process of software development life cycle.
Determine the steps involved in the process of writing and executing a program
and carry out an analysis of writing the code phase by discussing the potential challenges
faced.
Take a sample number and dry run the above two algorithms.
Show the outputs at the end of each iteration and the final output.
Examine what Big-O notation is and explain its role in evaluating efficiencies of algorithms.
Write the Python program code for the above two algorithms and critically evaluate their
efficiencies using Big-O notation.
the relationship between the written algorithm and the code variant.

Activity 2

Explain what is meant by a Programming Paradigm. Discuss and compare the main
characteristics of Procedural, Object oriented and Event-driven paradigms and the
relationships among them. Write small snippets of code as example for the above three
programming paradigms using a suitable programming language(s) and critically
evaluate the code samples that you have given above in relation to their structure and
the unique characteristics.

Activity 3 and Activity 4 are based on the following Scenario.

Grifindo Travels is the transport arm of Grifindo Leisure (Pvt) Ltd, an emerging travel & tour
company in Sri Lanka. It owns a fleet of vehicles ranging from cars, SUVs to vans.

The vehicles that it owns are hired or rented with or without a driver. The tariffs are based on
the vehicle type. Some of the vehicle types that it operates are, small car, sedan car, SVUs, Jeep
(WD), 7-seater van and Commuter van. New vehicle types are to be added in the future.

Vehicle rent, hire and sales options are described below.

1. Rent (With or without driver) – For each type of vehicle rates are given per day, per week
and per month. Rate for a driver also given per day. Depending on the rent period the total
rent amount needs to be calculated. For example: if a vehicle is rented for 10 days with a
driver, total amount to be calculated as follows:

Total rent = weeklyRent x 1 + dailyRent x 3 + dailyDriverCost x 10

2. Hire (with driver only) – These are based on packages such as airport drop, airport pickup,
100km per day package, 200km per day package etc. Standard rates are defined for a
package type of a vehicle type if that is applicable for that type of vehicle. For each package
maximum km limit and maximum number of hours area also defined. Extra km rate is also
defined which is applicable if they run beyond the allocated km limit for the tour. For day
tours if they exceed max hour limit, a waiting charge is applicable for extra hours. Driver
overnight rate and vehicle night park rate also defined which is applicable for each night
when the vehicle is hired for 2 or more days.

3. Sales – Once a rent (With/without driver) or hire (Day tour-hire/Long tour-hire) is


calculated it should be recorded in the database for further analysis purposes. All the
calculated rents and hires should record in the database with the date, time, type
(rent/hire) ,mode (with driver/without driver/day-tour hire/long-tour hire) and the
calculated amount.

Activity 3

Function 1: Rent calculation.


Return the total rent_value when vehicle_no, rented_date, return_date, with_driver
parameters are sent in. with_driver parameter is set to true or false depending whether the
vehicle is rented with or without driver.

Function 2: Day tour - hire calculation.


Calculate total hire_value when vehicle_no, package_type, start_time, end_time,
start_km_reading, end_km_reading parameters are sent in. Should return base_hire_charge,
waiting_charge and extra_km_charge as output parameters.
Function 3: Long tour - hire calculation.
Calculate total hire_value when vehicle_no, package_type, start_date, end_date,
start_km_reading, end_km_reading parameters are sent in. Should return base_hire_charge,
overnight_stay_charge and extra_km_charge as output parameters.

Function 4: Total sales calculation.


Return the total sales when the date_range ,type(rent/hire) and mode(with driver/without
driver/day-tour hire/long-tour hire) is given.

Write suitable algorithms for vehicle tariff calculation for rents and hires and for total
sales calculation. Ideally 4 functions should be developed for this purpose as above. Use
the visual studio IDE (using C#.net) to enhance and implement the above algorithms
and design the suitable database structure for keeping the tariffs for vehicle types and
different packages which must be used for implementing the above functions and the
provided database structure should record the calculated amounts of rents and hires
with the necessary information.
Analyze the features of an Integrated Development Environment (IDE) and explain how
those features help in application development. Evaluate the use of the Visual
StudioIDE for your application development contrasted with not using an IDE.
Activity 4

2
3
4
4.1 Design and build a small system to calculate vehicle hire amounts and record
them in a database for customer billing and management reporting for Grifindo Travels.
This includes the completing the database design started in 3.2 and implementing one
or more GUIs for vehicle, vehicle type, and package add/edit/delete functions. It
essentially requires an interface for hire calculation and recording function described
above. The implemented system should view all the sales for a given date range and
type(hire/rent) and mode (with driver/without driver/day-tour hire/long-tour hire) and
it should display the total sales according to the given parameter values.
4.2 Examine debugging process and the features available in Visual studio IDE for debugging
your code more easily. Evaluate how you used the debugging process to develop more
secure, robust application with examples.

4.3 Explain and outline the coding standards you have used in your application development.
Critically evaluate why a coding standard is necessary for the team as well as for the
individual.
Grading Rubric

Grading Criteria Achieved Feedback

LO1 Define basic algorithms to carry out an operation


and outline the process of programming an
application.

P1 Define an algorithm and outline the process in building an


application

P2 Determine the steps taken from writing code to


execution.

M1 Analyse the process of writing code, including the


potential challenges faced.
D1 Evaluate the implementation of an algorithm in a suitable
language and the relationship between the written algorithm
and the code variant

LO2 Explain the characteristics of procedural, object


orientated and event-driven programming

P3 Discuss what procedural, object orientated and event


driven paradigms are; their characteristics and the
relationship between them.

M2 Compare the procedural, object-orientated and event


driven paradigms used in given source code of an application

D2 Critically evaluate the source code of an application that


implements the procedural, object-orientated and event-
driven paradigms, in terms of the code structure and
characteristics.
LO3 Implement basic algorithms in code using an IDE.
P4 Write a program that implements an algorithm using an
IDE.

M3 Enhance the algorithm written, using the features of


the IDE to manage the development process.

D3 Evaluate the use of an IDE for development of


applications contrasted with not using an IDE.

LO4 Determine the debugging process and explain


the importance of a coding standard

P5 Explain the debugging process and explain the


debugging facilities available in the IDE.
P6 Explain the coding standard you have used in your code.

M4 Examine how the debugging process can be used to


help develop more secure, robust applications.

D4 Evaluate the role and purpose of a coding standard and


why it is necessary in a team as well as for the individual.
Contents
1.2 DEFINE WHAT IS ALGORITHM.............................................................................................2
Activity 01

1.2Define what is algorithm.


Algorithms are usually formed as functions in computing programming. These
functions act as small programs that can be referenced by larger programs. There are
often multiple ways to perform a particular operation within a software program.
Generally speaking, an algorithm is defined as a set of instructions designed to
perform a specific task. Algorithms work on inputs and outputs. It takes an input and
applies each step of the algorithm to that information to produce an output.
In simple, an algorithm is a set of instructions that can help you solve a problem
quickly. Algorithms are easy to understand and can be used to solve problems in a
specific order, making them very helpful for computers.

To obtain set of rules


Input from expected output Output
from the given input.

According to the above diagram, below is a simple explanation on the complexity of


an algorithm. Algorithm

Problem: A problem can be defined as a real-world problem or real-world instance


problem for which a program or set of instructions must be developed.
Algorithm: An algorithm is defined as a step-by-step process developed for a
problem.
Input: After designing the algorithm, the necessary and desired inputs are given to the
algorithm.
Processing unit: Inputs are passed to a processing unit that produces the desired
output.
Output: The results or results of the program are called outputs.
1.1.1 Outline the characteristics of a good algorithm.
Finiteness: The algorithm has a finite
number of steps and must terminate after a finite amount of time.
Input: Algorithms can have many inputs or no inputs at all.
Output: You should get at least one output.
Definiteness: Each step should be clear, well defined and precise. There should be no
ambiguity.
Effectiveness: Each step should be simple and take a limited amount of time.

1.1.2 What is Programming?


 A computer program comprises of code that's executed on a computer to
perform specific assignments.
 This code is composed by programmers. Programming is the method of giving
machines a set of informational that depict how a program ought to be carried
out. 
 Software engineers will spend their entirety careers learning an assortment of
programming dialects and instruments so they can successfully construct
programs.
1.1.3 Types of programming
languages
 There are hundreds of programming dialects in presence. Engineers will to begin
with consider desires of the application so they can choose which dialects would be
appropriate to use.
 Here are some well known programming dialects.
 Python
 JavaScript
 C/C++
 Java
 C#
 Ruby
 PHP
 Java Script is basically utilized in web advancement and is as a rule the
primary programming dialect learned by tenderfoot web engineers.
 JavaScript can too be utilized for portable and diversion improvement.

1.1.4 The Five main Steps of Programming Process


 Creating a program includes steps comparative to any problem-solving errand.
 There are five primary fixings within the programming process:
01. Step 01: Identify the problem
02. Step 02: Design the Solution
03. Step 03: Write the Program
04. Step 04: Test the Program
05. Step 05: Documentation and Maintenance
Step 01: Identify the problem
First you want to figure out what is it that you’re trying to solve. You need to make a
list of the requirements you’ll need to accomplish this task and the specifications of
the program you will be using.
Step 02: Design the Solution
You need to plan out how you’re going to solve this problem. The most commonly
used design method is call the Top-Down Design Method. There are many ways to
create an algorithm to help you like pseudocodes or flowcharts.
Step 03: Write the Program
First you must choose the correct programming language that best fits the need of
your solution. Remember to follow good programming styles.
Step 04: Test the Program
Testing must be done to ensure your program is functioning properly.

01. Debugging – this ensures that the program works and everything is coded
properly.
02. Logic Errors – this ensures that what happens in the program makes sense (just
because something functions doesn’t mean it will make sense).
03. Beta Testing - apply real-world variables to make sure the program can handle
normal circumstances.

Step 05: Documentation and Maintenance


Use Documentation to make sure that anyone using program is adhering to how it
works and the rules that revolve around it.
1.1.2 Steps involved in the process of writing and executing a program.
Program advancement is the method of making application programs. Program
development life cycle (PDLC), this process containing the several stages of program
advancement: analyzing, planning, coding, investigating and testing, and actualizing
and keeping up application program.

1. Problem analysis:
 The primary step within the
preparing of program enhancement is the total
understanding and recognizable proof of the issue for which is the program or
computer program is to be developed.
 In this step the issue must be characterized formally. All the factors like
Input/output, handling necessity, memory prerequisites, mistake taking care of,
meddle with other programs got to be taken into thought in this organize.

2. Program design:
 The following stage is the program design.
 This level lists all the instructions that are executed at various levels.
 These are plain English.
 You can call it strategy.
 The program designer make use of algorithms and flowcharts
to create the plan of the program.
 Algorithm - An algorithm is a set of instructions that can help you solve
a problem quickly.
 Flowcharts - A graphical tool that shows the steps/stages that are
executed in a program.

3. Coding:
 Once the design process is done, the real computer program is composed,
i.e. the informational are composed in a computer language. 
 Coding is by and large an awfully little portion of the complete
program advancement prepare additionally a less time devouring movement in
reality.
 In this handle all the sentence structure mistakes i.e. mistakes related to
spelling, lost commas, unclear names etc. are dispensed with.
 For successful coding a few of the direct lines which are connected are:
 Use of significant names and names of variables.
 Simple and clear expressions.
 Modularity
with accentuation on making modules generalized.
 Making utilize of comments and indenting the code properly.
 Avoiding bounced within the program to exchange control.

4. Debugging:
 At this stage we eliminate all bugs in the program.
 This is because as you write your code, some bugs may appear at that point.
 Here a program called DRY RUN is run manually.
 This is done several times until the program is rid of all bugs and the system is
bug free.
 A few common errors which might happen within the programs include: 
 Initialization of variables.
 Reversing of arrange of operands. 
 Confusion of numbers and characters.
 Inverting of conditions e.g.: jumping on zero rather than on not zero.
6. Testing:
 The program is tested on a number of appropriate test cases. 
 A test plan of the program must be done at the stage of the program plan itself.
This guarantees an intensive understanding of the specifications.
 The most minor and the foremost uncommon cases ought to be recognized and
tested.
 It is continuously useful to include the maximum and minimum values of
all factors as test information.

7. Documentation:
 Documentation is an exceptionally fundamental step within the program
development.
 Documentation help the clients and the individuals who maintain the software.
This guarantees that future alteration if required can be done effectively. 
 Moreover it is required amid updating and maintenance.
 Most programmers ignore this
stage for many reasons, but it is very important because it
helps programmers fix problems that may occur in their programs.
 There are two types of documentation:
1. The user manual provides users with complete information on how to
operate the program and what to do if problems arise.
2. The technical manual contains technical information about the program.
This is used to capture technical details of the program if the system is
not working properly or needs to be changed.

8. Maintenance:
 Updating and adjustment of the program for changed conditions and
field involvement is accounted for in maintenance. 
 Maintenance gets to be basic in taking after circumstances:
 Alter in specification
 Change in equipment
 Errors which are found amid the real execution of the program.

1.1.3 The Fibonacci series


 The Fibonacci series is the grouping of numbers (too called Fibonacci numbers),
where each number is the entirety of the going before two numbers, such that the
primary two terms are '0' and '1'. 
 A Fibonacci series can in this way be given as, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 . . . 
 It can be hence be watched that every term can be calculated by including the two
terms some time recently it. 
 Given the first  term, F0 and moment term, F1 as '0' and '1', the third term here
can be given as, F2 = + 1 = 1
o Similarly, F3 = 1 + 1 = 2 F4 = 2 + 1 = 3 2
 Therefore, to speak to any (n+1)th term in this arrangement, we are
able donate the expression as, Fn = Fn-1 + Fn-2. 
1.1.4 History of Fibonacci series
The first thing to know is that the grouping isn't initially Fibonacci's, who
in reality never went by that title. The Italian mathematician who we call Leonardo
Fibonacci was born around 1170, and initially known as Leonardo of Pisa, said Keith
Devlin, a mathematician at Stanford College. Only within the 19th century did students
of history come up with the epithet Fibonacci (generally meaning, "Son of the Bonacci
clan"), to recognize the mathematician from another popular Leonardo of Pisa, Devlin
said.

1.1.5 Following are Algorithms for the Fibonacci series


1. Iterative version Fibonacci
2. Recursive version Fibonacci
3. Tail recursive version Fibonacci
4. Lucas form Fibonacci
5. Exponential by Squaring Fibonacci
6. Matrix multiplication Fibonacci
1.1.6 Algorithms to display the Fibonacci series for the given
number using Pseudo Code
Step 1: Start
Step 2: Read number from User
Step 3: Initialize Variable a=0, b=1, i=1
Step 4: Display a, b Step
5: While i<=n-2
C=a +b
Display c a=c
i= i +1
END While
Step 6 Stop
1.1.7 Python Code for the Fibonacci series

1.1.8 Taking a sample and dry run of the Fibonacci series


Input A B C i 1<=n- Outpu
2 t
2
0 1 1
0
1
True

1.1.9 Critically evaluate the code for Fibonacci Series


 To induce the output for the
input 1, no of step is 2 (checks through 1st and 2nd if
statements). 
 To get the yield for the input 2, no of step is 3(checks through 1st, 2nd and 3rd if
statements).
 To get the yield for the input n, no of step is n + 2 (checks through 1st and 2nd,
if statements at that point it goes to while statement n times to urge output).
 So, the effectiveness of the code is (the running time or no of steps) n + 2.

1.1.10 The Factorial Numbers


 Factorial is a non-negative integer.
 It is the product of all positive integers less than or equal to that number you ask
for factorial. It is denoted by an exclamation sign (!).

Example:

n! = n* (n-1) * (n-2) *........1  
4! = 4x3x2x1 = 24    

1.1.11 History of Factorial Numbers


Within the year 1677, Fabian Stedman,
a British creator, characterized factorial as
an equivalent of alter ringing.  Alter ringing was a part of the melodic execution where
the performers would ring numerous tuned bells. And it was within the year 1808, when
a mathematician from France, Christian Kramp, came up with the image for factorial:
n!. The consider of factorials is at the root of a few subjects in arithmetic, such as the
number hypothesis, variable based math, geometry, likelihood, measurements,
hypothesis, charts and discrete science, etc.

1.1.12 Pseudocode for Finding Factorial of Number.


Step 01- Read number
Step 02- Fact = 1, i = 1
WHILE i<=number
Step 03- Fact=Fact*i
i=i+1
Step 04- END WHILE
WRITE Fact
Step 05- Stop
1.1.13 Python Code for Factorial Numbers.

1.1.14 Taking a sample number to dry run of Factorial of Number


Input f i I<=n Output
2
1 1
True
2
2
True
2
1.1.15 What’s the meaning of Big O notation

 Big O notation is a scientific notation that portrays the limiting behavior of a
function when the contention tends towards a particular value or infinity. It may
be a part of a family of notations designed by Paul Bachmann, Edmund Landau,
and others, collectively called Bachmann–Landau notation or
asymptotic notation.

1.1.16 Role in evaluating efficiencies of algorithms using Big O notation


 Big-O notation implies the relationship between the input to the calculation and
the steps required to execute the calculation. It is signified by a huge "O" taken
after by an opening and closing enclosure. Interior the bracket, the relationship
between the input and the steps taken by
the calculation is displayed utilizing "n".
What is Big O notion.
Activity 02
2.1 Define Programming Paradigm
 A programming worldview is the classification, fashion or way of
programming. It is an approach
to unravel issues by utilizing programming dialects. Depending on the language,
the trouble of employing a worldview differs.

 A programming organize is the classification, fashion, or strategy of a program.


It is an approach to issue fathoming utilizing programming dialects. Depending
on the language, the trouble of employing a worldview varies.
Event driven
Comparison between the event drive, project oriented, and procedure oriented.

 There are a few programming dialects that utilize ideal models, but in arrange to


do this they must take after a technique or technique.
2.1.1 Define Procedural Paradigm
 Procedural programming could be a concept of
programming that indicates an arrangement of well-structured steps
and methods (functions or sub-routines) inside its programming setting to
make a program.
 It is set of enlightening step by step that a computer must follow.
 A procedural programming can comprises of an arrangement of conditions
and work called rationale and its yield is very linear. 
 Strategies or capacities or sub-routines are actualized on
the information and factors to perform an errand.
 These strategies can be called anyplace between the program chain of
command, and by other strategies as well.
 Procedural dialect is additionally called as basic language. Procedural
programming does not fit for expansive scale development.

Example: C, Pascal, and Basic.

2.1.2 Key Features of Procedural Programming


 Predefined functions:
 A predefined work may be a work accessible in a procedural
programming dialect from a library of accessible capacities.
 These capacities permit a programmer to total common tasks
without making the specified code themselves. 
 This may offer assistance a engineer spare time amid generation.

 Global variables: 
 Global factors increment usefulness when nearby factors are deficiently. 
 Engineers can utilize worldwide factors in about all capacities.
When characterized universally, a variable makes itself accessible to
all strategies and capacities within the code, permitting the designer to get
to key information all
through the program's numerous methods.

 Parameter passing:
 Parameters are the information values that exchange from
each work inside a code arrangement.
 When utilizing parameter passing, designers put input parameters into a
module or gadget and get yield parameters in return.
 Parameters permit a software engineer to dole out passed information
to factors, conditions and commands inside a work to
a work to total computing activities on the information.

 Modularity:
 Modularity may be a structure in which
an engineer isolates the usefulness of its code into
an arrangement of littler squares.
 The software engineer can at that point call
these squares, frequently called strategies or capacities in procedural
programming dialects, in their code to access them.
 This makes vital capacities repeatable to make a more productive setup
code, compared to one that requires the software engineer to reuse the
same code at numerous focuses when counting a errand that
they require more than once.

 Top-down approach:

 Procedural programming depends on a top-down approach to plan and


creation. 
 Beneath this approach, a designer to begin
with characterizes the essential objective of the program, at that
point evaluates the components required to total it.
 They
may select to assist subdivide a few components of
the bigger objective into littler modules.
 From there, the engineer can start making their modules
to construct the code required to run their program.

2.1.3 Advantages of Procedural Programming


 Procedural Programming is great for general-purpose programming.
 The coded effortlessness at the side ease of usage of compilers and
interpreters.
 An expansive assortment of books and online
course fabric accessible on tried algorithms, making it less demanding to
memorize along the way.
 The source code is versatile, subsequently, it can be used to target
a distinctive CPU as well.
 The code can be reused completely different parts of the program, without
the ought to duplicate it.
 Through Procedural Programming method, the memory necessity too slashes.
 The program stream can be followed easily.
2.1.4 Disadvantages of Procedural Programming
 The program code is harder to compose when Procedural Programming is
employed
 The Procedural code is regularly not reusable, which may posture the ought
to reproduce the code if is required to utilize in another application
 Troublesome to relate with real-world objects
 The significance is given to the operation instead of the data, which might
posture issues in some data-sensitive cases
 The information is uncovered to the full program, making it not so much
security neighborly.
2.1.4 A small snippets of code as
example for the Procedural Programming

2.1.5 Define Object oriented

 Object-Oriented Paradigm is where we focus on real life


objects whereas programming any solution.
 The objective of an object-oriented program is to speak to the genuine world in code.
 In the object-oriented worldview, the issue is separated into littler parts called objects,
and frameworks are built around objects. 
 Objects are delineations of things that exist within the genuine world that we wish
to show in a computer framework.
The characteristics of Object Oriented programming are as takes after,
2.1.6 Key Features of Object-Oriented Programming
 Class definitions – Fundamental building pieces OOP and a
single substance which has information and operations on information together.
 Objects – The occasions of a lesson which are utilized in genuine usefulness –
its factors and operations.
 Abstraction – Indicating what to do but not how to do; an adaptable include for
having a in general see of an object’s functionality.
 Encapsulation
– Authoritative information and operations
of information together in a single unit – A course follow this feature.
 Legacy and lesson pecking order – Reusability and expansion of existing
classes.  
 Polymorphism – Different definitions for a single title - capacities with
same title with diverse usefulness; spares time
in contributing numerous work names Administrator and Work overloading.
 Generic classes – Class definitions for unspecified information. They are known
as holder classes. They are adaptable and reusable.
 Class libraries – Built-in dialect particular classes.
 Message passing – Objects communicates through conjuring strategies and
sending information to them. This highlight of sending and accepting data among
objects through work parameters is known as Message Passing.

2.1.7 Advantages of Object-Oriented Programming


 It’s conceivable that different cases of objects co-occur without any humiliation. 
 It’s really simple to parcel the work into a design grounded on objects. 
 It’s conceivable to frame the objects within the issue area to those within
the program. 
 Data hiding’s guideline is to assist the programmer to create secure programs that
cannot be struck by the code in other passages of the program. 
 By utilizing bequest, ready to avoid additional programs and amplify the utilize of
being classes. 
 The data-centered plan approach empowers us to capture advance points of
interest of the show in an implementable shape.

2.1.8 Disadvantages of Object-Oriented Programming


 We can’t apply OOP all over because it isn’t a widespread dialect.
It’s connected as it were when it’s required. It isn’t appropriate for all types
of issues. 
 Programmers got to have
brilliant planning abilities and programming aptitudes in
conjunction with appropriate arranging since the benefits of OOP are
a small bit precarious. 
 OOPs, take time to urge utilized to it. The study process included in object-
acquainted programming may not be normal for a few individuals. 
 Everything is treated as a protest in benefits of Uh oh so some time
recently applying it we got to have amazing considering in terms of objects.

2.1.9 A small snippets of code as example for the Object-Oriented Programming

2.2. A comparison between Procedural and Object Oriented Programming


Procedural Oriented Programming Object-Oriented Programming
In procedural programming, the program In object-oriented programming, the program
is divided into small parts called functions. is divided into small parts called objects.
Object-oriented programming
Procedural programming follows a bottom-up
follows a top-down approach.
approach.
There is no access specifier Object-oriented programming
in procedural programming. has access specifiers like
private, public, protected, etc.
Adding new data and Adding new data and
functions is not easy. function is easy.
In procedural programming, In object-oriented
there is no concept of data programming, the concept of
hiding and inheritance. data hiding and inheritance is
used.
In procedural programming, In object-oriented
the function is more programming, data is more
important than the data. important than function.
Procedural programming Object-oriented programming
is based on the unreal is based on the real world.
world.
Procedural programming is Object-oriented programming
used for designing medium- is used for designing large
sized programs. and complex programs.
Procedural programming Object-oriented programming
uses the concept of uses the concept of data
procedure abstraction. abstraction.
Code reusability absent in Code reusability present in
procedural programming, object-oriented
programming.
Examples: C, FORTRAN, Examples: C++, Java,
Pascal, Basic, etc. Python, C#, etc.
2.2.1 Define Event-driven paradigms
 Event-driven programming centers on occasions. In the long
run, the stream of program depends upon occasions.
 Until presently, we were managing with either consecutive or parallel
execution show but the demonstration having the concept of event-driven
programming is called offbeat show.
 Event-driven programming depends upon
an occasion circle that's continuously tuning in for
the unused approaching occasions.
 The working of event-driven programming is subordinate upon occasions.
 Once an occasion circles, at that point occasions choose what to execute and in
what arrange. 
Following flowchart will assist you get it how this;

2.2.2 Key Features of Event-driven Programming


 Event - An occasion is an activity that can
be responded to. Cases of occasions incorporate mouse clicks, key
presses, information input from
sensors, messages being sent from other programs and so
on. 
 Event Handler - The occasion handler is the piece of code that's planning to run
in reaction to an occasion. Say you want a message to seem when a button is
clicked: the button being clicked is the occasion, and the occasion handler is the
code that creates the message appear. 
 Event Loop - The occasion circle may be a line information structure, and it
contains a list of occasions that have been raised, alongside any relevant data
(for case the x and y arranges of a mouse click). 
 Benefit Situated Processing - The most effortless illustration to get it is the
USB gadget acknowledgment benefit on a present day PC. When a
USB gadget is connected or evacuated, an occasion is raised and dispatched to
the program benefit, which empowers interaction to decide, among other things,
what activity to require with the modern device.
 Time Driven- Time-driven implies that the framework is sensitive to
time. Typically most effortless to comprehend with
an illustration – maybe an alert clock.
 Trigger Function - Trigger capacities are
the stick that coordinate occasions to occasion.
2.2.3 Advantages of Event-driven paradigms

You might also like