Programming Assigment New
Programming Assigment New
Give details:
Internal Verifier
Date
signature
Programme Leader
Date
signature (if required)
Higher Nationals - Summative Assignment Feedback Form
Student Name/ID H M A M Jayathilake / E186202
Unit Title Programming
Assignment Number 01 Assessor Mr. Lasitha Ranawaka
10-03-2023 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.
LO2. Explain the characteristics of procedural, object-orientated and event-driven programming, conduct an analysis of a suita
Integrated Development Environment (IDE).
LO4. Determine the debugging process and explain the importance of a coding standard.
Pass, Merit & Distinction Descripts P4 P5 M4 D4
* 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
Assessor Date
signature
[email protected]
Student Date
signature
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.
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.
Submission Format
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)
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.
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.
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, ……..
Fn = F n-1 + F n-2
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. 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.
Activity 2
2.1 Compare and discuss what is meant by a Programming Paradigm and 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.
Grifindo Toys is a small-scale Toy building company which is located in United Kingdom
(UK) and currently they have 50 employees working at their headquarters. They are looking
for a simple payroll system to calculate the salaries of their employees and you are hired as a
freelance software developer to build their payroll system.
Specifications for the payroll system as follows,
Grifindo Toys Payroll System mainly contains five components and the specifications for the
components are follows,
1. Employee Component.
• Admin should be able to update all employee details in the system (Update and
Delete including monthly salary, overtime rates-hourly, allowances).
• Admin should be able to view individual employee details, view all employees
details, search employees.
2. Salary Component
Admin should be able to input the date range to calculate the salary. Salary cycle
begin date and the end date should be given to calculate the monthly salary.
Salary cycle begin date and end date will be defined in the settings component
and if the user enters something else the system should display an error message.
The admin should be able to enter the no of leaves an employee has taken with
number of absent days, no of holidays for the given date range. If an employee
has worked any overtime hours the admin should be able to enter that also when
calculating the Base pay value.
Base Pay need to calculate based on the following points,
No-pay-value = (Total_Salary/salary_cycle_date_range)
*No_of_absent_days
All the calculated No-pay-value, Base-pay-value and Gross pay value should
record in the database under each employee for each month. This component
should generate reports such as monthly salary report for an employee, overall
salary summary for couple of months for an employee, No-pay-value, base-pay-
value, and gross pay value of all the employees for a given month range.
3. Settings Component
This component should allow the admin to change parameter values such as
i. Date Range for a salary cycle. Eg:- 30 days
Activity 3
Write the complete pseudocode for the salary component of the above system (report
generation is not needed). Use the visual studio IDE (using C#.net) to implement the
above three components. Ideally there should be three separate classes for the above
three components and the developer can decide the methods which need to include in
those classes. Design the suitable database structure for keeping the data of the above
system.
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
4.1 Design and build a small GUI system for the above scenario and it should be a complete
functional system with all the functions which has described in the above scenario with the
database structure which has designed in activity 3.
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
Student ID - E186202
Subject - Programming
Date - 10-03-2023
Contents
1.0 Task 01............................................................................................................................ 1
1.1 What is an Algorithm ................................................................................................. 1
1.1.1 What are the Characteristic of an Algorithm .................................................................. 3
1.1.2 Different type of Algorithm ............................................................................................. 4
1.2. How to use Pseudo Code in Algorithm ..................................................................... 5
1.2.1 Pseudo code for Fibonacci Series .................................................................................... 5
1.2.2 Pseudo code for Factorial Value ...................................................................................... 7
1.3 Big O Notation ............................................................................................................ 8
1.3.1 Bog O Notation role in evaluating efficiency of algorithms ............................................ 9
1.3.2 Python code for Fibonacci series ................................................................................... 10
1.3.2 Python code for Factorial Value .................................................................................... 11
1.4 Process of building an application ........................................................................... 12
1.5 Steps taken from writing to executing a code. ........................................................ 15
1.5.1 Computer Programing and Coding ................................................................................ 16
1.5.2 Importance of Algorithms ............................................................................................. 16
2.0 Task 02.......................................................................................................................... 17
2.1 Programming Paradigm ........................................................................................... 17
2.1.1 Type of Paradigm ........................................................................................................... 17
2.2 Procedural Programming ......................................................................................... 19
2.2.1 Characteristics of procedural programming ................................................................. 20
2.3 Object-oriented Programming ................................................................................. 22
2.3.1 Characteristics of Object-Oriented Programming ......................................................... 23
2.4 Event - Driven Paradigms ......................................................................................... 25
2.4.1 Characteristics of event driven paradigm. .................................................................... 26
2.5 Procedural programming vs Object oriented programming ................................... 27
2.6. Object oriented programming vs Event driven programming................................ 29
3.0 Task 03 .................................................................................................................... 31
3.1 Integration Development Environment (IDE) .......................................................... 31
3.1.1 Important of IDE ..................................................................................................... 31
3.1.2 Type of IDE..................................................................................................................... 32
3.1.3 Advantage of IDEs.......................................................................................................... 33
3.1.4 Disadvantages of the IDEs ............................................................................................. 34
3.2 Application developed using Visual studio For Grifindo Toys Company ............ 35
3.2.1 Interface for Grifindo Toys ..................................................................................... 36
3.2.2 Database for Grifindor Toy Company ............................................................................ 43
3.2.1 Programing code and Successful massages .................................................................. 45
4.0 Task .............................................................................................................................. 49
4.1 Debugging ................................................................................................................ 49
4.1.1 Process of Debugging .................................................................................................... 49
4.1.2 Advantages of Debugging .............................................................................................. 51
4.1.3 Various Debugging Tools ............................................................................................... 51
4.14 Evaluation of the use debugging towards developing secure and robust application .. 52
4.2. Coding Standers ...................................................................................................... 53
4.2.1 Purpose of Having Coding Standards: ........................................................................... 53
4.2.2 Advantages of Coding Guidelines: ................................................................................. 56
References.......................................................................................................................... 57
Table of Figures
1
There are some examples for solving simple problem using a simple algorithm.
It generates the required result from a set of inputs.
Example 01
Add two numbers entered by the user
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result to sum.
sum←num1+num2
Step 5: Display sum
Step 6: Stop
Example 02
Find the largest number among three numbers
Step 1: Start
Step 2: Declare variables a,b and c.
Step 3: Read variables a,b and c.
Step 4: If a > b
If a > c
Display a is the largest number.
Else
Display c is the largest number.
Else
If b > c
Display b is the largest number.
Else
Display c is the greatest number.
Step 5: Stop
2
1.1.1 What are the Characteristic of an Algorithm
Algorithms provide us the procedure to solve any problem. Below are some
characteristics that define a good algorithm
2. Independent
Any algorithm that is developed should be written in a way that it can be easily
understood and utilized with any programming language. Language independence refers
to the fact that a successful algorithm will always provide the same results, regardless of
the computer language used to implement it.
3. Input
An algorithm should have one or more inputs. The input is the data to be transformed
during the computation to produce the output.
4. Output
An algorithm may produce one or more outputs. Output precision also requires that you
know what kind of data, how much and what form the output should be
5. Finiteness
An Algorithm must have ended. Algorithm must stop after a finite number of instructions
are executed. Stopping may mean that you get the expected output OR you get a response
that no solution is possible.
3
6. Effectiveness
An algorithm should not be complex. Every instruction must be carried out effectively. A
human should be able to calculate the exact values involved in the procedure of the
algorithm using paper & pencil.
There are several types of algorithms, all designed to accomplish different tasks. For
example, algorithms perform the following:
4
Dynamic programming algorithm
This algorithm solves problems by dividing them into subproblems. The results are then
stored to be applied for future corresponding problems.
Brute-force algorithm
This algorithm iterates all possible solutions to a problem blindly, searching for one or
more solutions to a function.
Sorting algorithm
Sorting algorithms are used to rearrange data structure based on a comparison operator,
which is used to decide a new order for data.
Hashing algorithm
This algorithm takes data and converts it into a uniform message with a hashing
Randomized algorithm
This algorithm reduces running times and time-based complexities. It uses random
elements as part of its logic.
We used Pseudo code for creating and outline or a rough draft of a program. It is an
informal way of programming description it not require any strict programming language
syntax.Pseudocode is used to describe an algorithm's fundamental ideas because it is effe
ctive and environment and because it is simpler for people to grasp than traditional
programming language code.
Here are some examples for create algorithm using Pseudo Code.
A series of numbers in which each number is the sum of the two preceding or previous
numbers is called Fibonacci Series.
5
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the
recurrence relation.
Fn = F n-1 + F n-2
Step 1: Start
Step 2: Declare variable a, b, c, n, i
Step 3: Initialize variable a=0, b=1 and i=2
Step 4: Read n from user
Step 5: Print a and b
Step 6: Repeat until i<=n:
Step 6.1: c=a+b
Step 6.2: print c
Step 6.3: a=b, b=c
Step 6.4: i=i+1
Step 7: Stop
Variables a and b are initialized to 0 and 1 respectively. In Step 5, We directly print a and
b, So the Output till Step 5 is- 0 1
In Step 6, value of "i" is 2 as the first two numbers (0, 1) are already printed. Now for
every iteration of "i", we add a and b, so variable "c" now becomes 1 (i.e., 0+1). Then the
value of "c" is printed. So, Output now becomes - 0 1 1
In Step 6.3, we move 2nd last value (which is stored in variable "b") to variable "a" and
last value (which is stored in variable "c") to b. So now, a=1, b=1
In Step 6.4, Value of "i" is incremented by 1(i.e., i=i+1) and iteration again continues
until value of "i" is less than user entered number "n".
So, for i=3, Again following steps 6.1 to 6.4, Output will be- 0 1 1 2
6
So, for i=4, Again following steps 6.1 to 6.4, Output will be- 0 1 1 2 3
So, for i=5, Again following steps 6.1 to 6.4, Output will be- 0 1 1 2 3 5
For i=6, condition i less than n becomes false as (6<=5) is false. Hence the Final Output
will be - 0 1 1 2 3 5
Initial 0 1 01
The factorial of a non-negative integer n, denoted by n!, is the product of all positive
integers less than or equal to n.
Step 1: Start
Step 2: Declare variables x, n, i
Step 3 – Initialize variable x = 7, i = 1
Step 3: Read n from user.
7
Step 4: Repeat until i <= 1
Step 4.1: x = n - 1
Step 4.2: y = n * x
Step 4.3: n = x
Step 4.4: i = i - 1
Step 5: Print x
Step 6: End
Initial
Big O notation is a way to characterize the time or resources needed to solve a computing
problem. It's particularly useful in comparing various computing algorithms under
consideration. Below is a table summarizing Big O functions.
Big-O notation is a "simplified analysis of an algorithm's efficiency". Big-O gives us an
algorithm's complexity in terms of the input size (N) and it's independent of the machine
we run the algorithms on. Big-O can give us the time but also space complexity of an
algorithm (Vladimir, 2021).
8
The four most commonly referenced and important to remember are:
- O(1) Constant access time such as the use of a hash table.
- O(log n) Logarithmic access time such as a binary search of a sorted table.
- O(n) Linear access time such as the search of an unsorted list.
- O(n log(n)) Multiple of log(n) access time such as using Quicksort or Merge sort.
9
Before starting with the code, here is a list of simple rules to follow when calculating time
or space complexity of an algorithm:
- Divide your algorithm into single operations or functions.
- Calculate the complexity of each operation.
- Add up the resulting big Os.
- Remove any constant and the lower order terms. Keep only the highest order term
(the fastest growing one), which will be the big O of your algorithm.
Let's look at some specific examples to help everything become obvious. Python will be
used for the code examples because of its straightforward, English-like syntax that
anyone can grasp. In order to keep the article short, I'll emphasize time complexity rather
than spatial complexity. I didn't feel the need to go into great depth because the same
criteria apply in any case.
10
As an example, Fibonacci Number of 10
11
As an example, Factorial Number of 10
SDLC is a systematic process for building software that ensures the quality and
correctness of the software built. SDLC process aims to produce high-quality software
that meets customer expectations. The system development should be complete in the
pre-defined time frame and cost. SDLC consists of a detailed plan which explains how to
plan, build, and maintain specific software. Every phase of the SDLC life Cycle has its
own process and deliverables that feed into the next phase. SDLC stands for Software
Development Life Cycle and is also referred to as the Application Development life-cycle
(Martin, 2023).
12
SDLC Phases
The entire SDLC process divided into the following SDLC steps:
Phase 3: Design
In this third phase, the system and software design documents are prepared as per the
13
requirement specification document. This helps define overall system architecture.
This design phase serves as input for the next phase of the model (Martin, 2023).
Phase 4: Coding
Once the system design phase is over, the next phase is coding. In this phase, developers
start build the entire system by writing code using the chosen programming language. In
the coding phase, tasks are divided into units or modules and assigned to the various
developers. It is the longest phase of the Software Development Life Cycle process.
In this phase, Developer needs to follow certain predefined coding guidelines. They also
need to use programming tools like compiler, interpreters, debugger to generate and
implement the code (Martin, 2023).
Phase 5: Testing
Once the software is complete, and it is deployed in the testing environment. The testing
team starts testing the functionality of the entire system. This is done to verify that the
entire application works according to the customer requirement.
During this phase, QA and testing team may find some bugs/defects which they
communicate to developers. The development team fixes the bug and send back to QA
for a re-test. This process continues until the software is bug-free, stable, and working
according to the business needs of that system (Martin, 2023).
Phase 6: Installation/Deployment
Once the software testing phase is over and no bugs or errors left in the system then the
final deployment process starts. Based on the feedback given by the project manager, the
final software is released and checked for deployment issues if any(Martin, 2023).
Phase 7: Maintenance
Once the system is deployed, and customers start using the developed system, following 3
activities occur
- Bug fixing – bugs are reported because of some scenarios which are not tested at
all
- Upgrade – Upgrading the application to the newer versions of the Software
- Enhancement – Adding some new features into the existing software
14
The main focus of this SDLC phase is to ensure that needs continue to be met and that the
system continues to perform as per the specification mentioned in the first phase (Martin,
2023).
15
have made a change in the program or how to write a program
Coding is used for communicating with computers. People use coding to give computers
and other machines instructions on what actions to perform. We also use computer code
to program the websites, apps, and other technologies we interact with every day.
Computer coding is the use of computer programming languages to give computers and
machines a set of instructions on what actions to perform. Coding is how humans
communicate with machines. It’s what allows us to create computer software like
programs, operating systems, and mobile applications (Mulongo, 2022).
A program or the code is the name given to the set of instructions. Although they are
extremely intelligent devices, computers still need people to complete tasks.
Algorithms are a very important topic in Computer Science because they help software
developers create efficient and error-free programs.
As a developer, algorithms help you learn different techniques to efficiently solve those
problems.
A problem can be solved in many ways using different algorithms.
Every algorithm comes with its own trade-offs, and some are much better than others
when it comes to performance.
Here is some importance of the Algorithm;
16
2.0 Task 02
Paradigm can also be termed as method to solve some problem or do some tasks.
Programming paradigm is an approach to solve problem using some programming
language or also we can say it is a method to solve a problem using tools and techniques
that are available to us following some approach. There are lots for programming
language that are known but all of them need to follow some strategy when they are
implemented and this methodology/strategy is paradigms. Apart from varieties of
programming language there are lots of paradigms to fulfill each and every demand
(geeksforgeeks, 2022).
17
1. Imperative Programming Paradigm
It is one of the oldest programming paradigms. It features close relation to machine
architecture. It is based on Von Neumann architecture. It works by changing the program
state through assignment statements. It performs step by step task by changing state. The
main focus is on how to achieve the goal. The paradigm consists of several statements
and after execution of all the result is stored.
Advantage
- Very simple to implement
- It contains loops, variables etc.
- It is efficient.
Disadvantages
- We cannot choose it for solving complex problems.
- It is less efficient and less productive.
- It is not suitable for parallel programming.
- Order is crucial.
18
Advantages
- Short, efficient code
- Can be implemented using methods not yet known at the time of programming
- Easy optimization as implementation is controlled by an algorithm
- Maintenance possible independent of application development
Disadvantages
- Sometimes hard to understand for external people
- Based on an unfamiliar conceptual model for people (solution state)
- Hard to take characteristics of individual applications into account during
programming
The paradigm deals with procedure calls that are called routines or functions. the
functions contain a series of computational commands to be carried out to achieve a
certain outcome.
It is just like a procedure, with a list of step-by-step instructions for the computer program
to follow. The code can easily be reused in different parts of the program. The advantage
of the paradigm is that the code can be easy to learn and read in simple programs.
Though, while dealing with a complex problem, we run the risk of ending up with a huge
volume of code (javatpoint, 2023).
19
Example of procedural programming is BASIC, C, and Pascal.
Predefined functions
A predefined function is typically an instruction identified by a name. Usually, the
predefined functions are built into higher-level programming languages, but they are
derived from the library or the registry, rather than the program. One example of a pre-
defined function is ‘charAt()’, which searches for a character position in a string.
Local Variable
A local variable is a variable that is declared in the main structure of a method and is
limited to the local scope it is given. The local variable can only be used in the method it
is defined in, and if it were to be used outside the defined method, the code will cease to
work.
20
Global Variable
A global variable is a variable which is declared outside every other function defined in
the code. Due to this, global variables can be used in all functions, unlike a local variable.
Modularity
Modularity is when two dissimilar systems have two different tasks at hand but are
grouped together to conclude a larger task first. Every group of systems then would have
its own tasks finished one after the other until all tasks are complete.
Parameter Passing
Parameter Passing is a mechanism used to pass parameters to functions, subroutines or
procedures. Parameter Passing can be done through ‘pass by value’, ‘pass by reference’,
‘pass by result’,‘pass by value-result’ and ‘pass by the name’.
21
the code if is needed to use in another application
- Difficult to relate with real-world objects
- The importance is given to the operation rather than the data, which might pose
issues in some data-sensitive cases
- The data is exposed to the whole program, making it not so much security friendly
22
2.3.1 Characteristics of Object-Oriented Programming
1. Class
A class is a user-defined data type. It consists of data members and member functions,
which can be accessed and used by creating an instance of that class. It represents the set
of properties or methods that are common to all objects of one type. A class is like a
blueprint for an object (interviewbit, 2022).
2. Object
It is a basic unit of Object-Oriented Programming and represents the real-life entities. An
Object is an instance of a Class. When a class is defined, no memory is allocated but
when it is instantiated (i.e. an object is created) memory is allocated. An object has an
identity, state, and behavior. Each object contains data and code to manipulate the data.
Objects can interact without having to know details of each other’s data or code, it is
sufficient to know the type of message accepted and type of response returned by the
objects (interviewbit, 2022).
3. Data Abstraction
Data abstraction is one of the most essential and important features of object-oriented
programming. Data abstraction refers to providing only essential information about the
data to the outside world, hiding the background details or implementation (interviewbit,
2022).
4. Encapsulation
Encapsulation is defined as the wrapping up of data under a single unit. It is the
mechanism that binds together code and the data it manipulates. In Encapsulation, the
variables or data of a class are hidden from any other class and can be accessed only
through any member function of their class in which they are declared. As in
encapsulation, the data in a class is hidden from other classes, so it is also known as data-
hiding (interviewbit, 2022).
5. Inheritance
23
Inheritance is an important pillar of OOP(Object-Oriented Programming). The capability
of a class to derive properties and characteristics from another class is called Inheritance.
When we write a class, we inherit properties from other classes. So when we create a
class, we do not need to write all the properties and functions again and again, as these
can be inherited from another class that possesses it. Inheritance allows the user to reuse
the code whenever possible and reduce its redundancy (interviewbit, 2022).
6. Polymorphism
The word polymorphism means having many forms. In simple words, we can define
polymorphism as the ability of a message to be displayed in more than one form. For
example, A person at the same time can have different characteristics. Like a man at the
same time is a father, a husband, an employee. So the same person posses different
behavior in different situations. This is called polymorphism (interviewbit, 2022).
7. Dynamic Binding:
In dynamic binding, the code to be executed in response to the function call is decided at
runtime. Dynamic binding means that the code associated with a given procedure call is
not known until the time of the call at run time. Dynamic Method Binding One of the
main advantages of inheritance is that some derived class D has all the members of its
base class B. Once D is not hiding any of the public members of B, then an object of D
can represent B in any context where a B could be used. This feature is known as subtype
polymorphism (interviewbit, 2022).
8. Message Passing:
It is a form of communication used in object-oriented programming as well as parallel
programming. Objects communicate with one another by sending and receiving
information to each other. A message for an object is a request for execution of a
procedure and therefore will invoke a function in the receiving object that generates the
desired results. Message passing involves specifying the name of the object, the name of
the function, and the information to be sent (interviewbit, 2022).
24
- OOP mimics the real world, making it easier to understand
- Since objects are whole within themselves, they are reusable in other programs
Disadvantages of Object-oriented Programming
- Object-Oriented programs tend to be slower and use up a high amount of memory
- Over-generalization
- Programs built using this paradigm may take longer to be created
25
2.4.1 Characteristics of event driven paradigm.
Service Oriented
Service oriented is a key feature in event-driven programming that used to write programs
that are made for services and it takes does not slow down the computer as service
oriented only consume little of the computer processing power and usually services run in
the background of OS.
Time Driven
In event driven programming, time driven is a paradigm, it’s a code that runs on a time
trigger, time driven can be a specific code that runs on a specific time, which could be
once an hour, once a week or once a month, this means it’s a pre-set to do task. For
example, windows update is the example of time driven, which user can set when to
update or when to check and download the update.
Event Handlers
Event handlers is a type of function or method that run a specific action when a specific
event is triggered. For example, it could be a button that when user click it, it will display
a message, and it will close the message when user click the button again, this is an event
handler.
Trigger Functions
Trigger functions in event-driven programming are a functions that decide what code to
run when there are a specific event occurs, which are used to select which event handler
to use for the event when there is specific event occurred.
Events
Events include mouse, keyboard and user interface, which events need to be triggered in
the program in order to happen, that mean user have to interacts with an object in the
program, for example, click a button by a mouse, use keyboard to select a button and etc
(ukessays, 2021).
26
- Simplicity of programming
- Allows hardware and sensors to interact with software.
- Allow interactive programs
Procedure Method
Record Object
Module Class
Based on Characteristics
Procedural programming has Local variables, sequence, selection, iteration, and
modularization. Object-oriented programming has Objects, methods, message passing,
information hiding, data abstraction, encapsulation, polymorphism, inheritance,
serialization-marshalling.
27
Accessing modes
In Object-oriented programming, there are three accessing modes – Public, Private, and
Protected. There are no such access modes in Procedural programming.
Execution
In Object-oriented programming, various functions can execute simultaneously. In
procedural programming, there is a systematic approach in which functions get executed
step-by-step.
Data Control
In Object-oriented programming, data and functions are accessible within the same class
while in procedural programming, data can move freely.
Security
Object-oriented programming is more secure than procedural programming, because of
the level of abstraction or we can say data hiding property. It limits the access of data to
the member functions of the same class. While there is no such data hiding in the
procedural programming paradigm.
Process
Object-Oriented programming follows the bottom-up approach while Procedural
programming follows the top-down approach while designing a program.
Division
In Object-oriented programming, the program is divided into small entities called objects
whereas in Procedural programming the program is divided into sub-procedures.
It focuses on the process and functions. It focuses on the data and classes.
28
and maintain it.
It focuses on procedure rather data which It focuses on data rather than procedures.
has priority in data-driven systems.
Data hiding is not possible. Data hiding is possible, hence more secure
than procedural.
It has no such concepts like Inheritance. It has four main concepts – Abstraction,
Encapsulation, Inheritance, and
Polymorphism.
The different parts of the program are The different functions of objects are
connected via parameter passing. connected via message passing.
Much like the OPP approach, Event-Driven Programming (EDP) has its pros and cons
when it comes to creating the necessary environment. For instance, the specified
approach implies that the premises for quick prototyping should be created. The
phenomenon of prototyping is traditionally rendered as the style of programming that
29
involves “object-oriented programming in which behavior reuse (known as inheritance) is
performed via a process of cloning existing objects that serve as prototypes” (Prototype-
based programming, 2016, par. 1).
The EDP strategy, in its turn, offers ample opportunities for prototyping; moreover,
prototyping implies that net elements should be incorporated into the general concept:
“Local parameters, as well as locally interpretable and executable prototype programs can
be associated with the net elements” (Varga & Scukas, 2015). The phenomenon of
prototyping, in its turn, is a vital part of an information management system’s
functioning.
Another important characteristic trait of the EDP approach that the PP method does not
permit incorporating into the framework, the fact that the designated approach suggests
an easier interaction between the elements of hardware with the corresponding parts of
the software (). Indeed, the process of linking the specified elements into a single entity
so that its elements could become a part of a well-functioning mechanism can be viewed
as the trait that is especially characteristic of the EDP approach as opposed to the existing
alternative (premium-papers, 2022).
30
3.0 Task 03
Most integrated development environments (IDEs) include functionality that goes beyond
text editing. They provide a central interface for common developer tools, making the
software development process much more efficient. Developers can start programming
new applications quickly instead of manually integrating and configuring different
software. They also don't have to learn about all the tools and can instead focus on just
one application. The following are some reasons why developers use IDEs:
Code editing automation
Programming languages have rules for how statements must be structured. Because an
IDE knows these rules, it contains many intelligent features for automatically writing or
editing the source code.
Syntax highlighting
An IDE can format the written text by automatically making some words bold or italic, or
by using different font colors. These visual cues make the source code more readable and
give instant feedback about accidental syntax errors.
Intelligent code completion
Various search terms show up when you start typing words in a search engine. Similarly,
31
an IDE can make suggestions to complete a code statement when the developer begins
typing.
Refactoring support
Code refactoring is the process of restructuring the source code to make it more efficient
and readable without changing its core functionality. IDEs can auto-refactor to some
extent, allowing developers to improve their code quickly and easily. Other team
members understand readable code faster, which supports collaboration within the team.
Local build automation
IDEs increase programmer productivity by performing repeatable development tasks that
are typically part of every code change. The following are some examples of regular
coding tasks that an IDE carries out.
Compilation
An IDE compiles or converts the code into a simplified language that the operating
system can understand. Some programming languages implement just-in-time compiling,
in which the IDE converts human-readable code into machine code from within the
application.
Testing
The IDE allows developers to automate unit tests locally before the software is integrated
with other developers' code and more complex integration tests are run.
Debugging
Debugging is the process of fixing any errors or bugs that testing reveals. One of the
biggest values of an IDE for debugging purposes is that you can step through the code,
line by line, as it runs and inspect code behavior. IDEs also integrate several debugging
tools that highlight bugs caused by human error in real time, even as the developer is
typing.
32
01. Local IDEs
Developers install and run local IDEs directly on their local machines. They also have to
download and install various additional libraries depending on their coding preferences,
project requirements, and development language. While local IDEs are customizable and
do not require an internet connection once installed, they present several challenges:
- They can be time consuming and difficult to set up.
- They consume local machine resources and can slow down machine performance
significantly.
- Configuration differences between the local machine and the production
environment can give rise to software errors.
33
features are supposed to help you organize resources, prevent mistakes, and provide
shortcuts.
Project management
This can be twofold. First, many IDEs have documentation tools that either automate the
entry of developer comments, or may actually force developers to write comments in
different areas. Second, simply by having a visual presentation of resources, it should be
a lot easier to know how an application is laid out as opposed to traversing the file system
for arcane files in the file system (salman, 2023).
Learning curve
IDEs are complicated tools. Maximizing their benefit will require time and patience.
34
3.2 Application developed using Visual studio For Grifindo Toys Company
35
3.2.1 Interface for Grifindo Toys
Login Page
This is the first interface of the system. The user must enter username and password to
enter to the system.
36
Home Page
37
Employee Registration interface
In this stage user can register Employee. Here the Employees’ name, address, NIC, phone
number, license No., Date of birth and email are entered into the system. Also, all the
entered data is saved in database.
38
Employee Salary
In this interface user can calculate the monthly salary using their salary parameters.
39
Employee Leave Maintenance
40
Employee Login Maintenance
In this interface user can maintenance the user login and their levels
41
Employee Login Maintenance
In this interface user can maintenance the user login and their levels
42
3.2.2 Database for Grifindor Toy Company
43
Employee Registration Table
Leave Table
44
3.2.1 Programing code and Successful massages
45
Update employee table data
46
Delete Data from Employee table
47
Code for salary calculation
48
4.0 Task
4.1 Debugging
Debugging and testing are complementary processes. The purpose of testing is to identify
what happens when there is a mistake in a program's source code. The purpose of
debugging is to locate and fix the mistake.
49
The testing process does not help the developer figure out what the coding mistake is -- it
simply reveals what effects the coding error has on the program. Once the mistake has
been error identified, debugging helps the developer determine the cause of the error so it
can be fixed (Tawde, 2022).
50
4.1.2 Advantages of Debugging
For identifying and fixings bugs various tools have been used, debugging tools is a
software program that is being used to test and debug other software programs. There are
many open-source debugging tools available in the market like DBX, GDB, etc.
51
4.1.4 Debugging Strategies
Below are the different strategies are as follows:
1. Learning Strategy
Before finding a bug in the software or product it is very important to learn that software
or product very carefully. Because without any knowledge you cannot find errors. If you
know the system very well and you know how it works then only you can find bugs in
that software.
2. Experience
Previous experience can help you to find similar types of bugs and also the solution for
resolving bugs. It depends upon the individual expert’s experience that how could he/she
finds the bus quickly.
3. Forward Analysis
forward analysis of programs involves tracking program forward using print statements or
breakpoints at different points. It is more concerned with the location where the wrong
outputs are obtained.
4. Backward Analysis
Backward analysis of the program involves the tracking program backward from the
location where errors occur to identify the region of the faulty code.
4.14 Evaluation of the use debugging towards developing secure and robust
application
The dispersion of infrastructures in use today is getting worse. Even though the main goal
of this is to maintain huge programs quickly, it is difficult to track the bug back to its
source, making it difficult to debug. A distributed application has a lot of moving parts,
thus any problem must first be isolated in order to identify its root cause.
Serverless computing serves as an example of this idea. It uses a distributed architecture
and acts as an abstraction of the underlying application's capabilities and supporting
infrastructure. This design separates the application's functional components, which are
housed on managed infrastructure and consist of specialized programming functions.
52
It uses a distributed architecture and acts as an abstraction of the underlying application's
capabilities and supporting infrastructure. This design separates the application's
functional components, which are housed on managed infrastructure and consist of
specialized programming functions.
Different modules specified in the design document are coded in the Coding phase
according to the module specification. The main goal of the coding phase is to code from
the design document prepared after the design phase through a high-level language and
then to unit test this code.
Good software development organizations want their programmers to maintain to some
well-defined and standard style of coding called coding standards. They usually make
their own coding standards and guidelines depending on what suits their organization best
and based on the types of software they develop. It is very important for the programmers
to maintain the coding standards otherwise the code will be rejected during code review
(geeksforgeeks, 2022).
53
Some of the coding standards are given below:
Naming conventions for local variables, global variables, constants and functions:
54
letters.
- The name of the function must describe the reason of using the function clearly
and briefly.
Indentation:
Proper indentation is very important to increase the readability of the code. For making
the code readable, programmers should use White spaces properly. Some of the spacing
conventions are given below:
- There must be a space after giving a comma between two function arguments.
- Each nested block should be properly indented and spaced.
- Proper Indentation should be there at the beginning and at the end of each block in
the program.
- All braces should start from a new line and the code following the end of braces
also start from a new line.
55
Code should be well documented:
The code should be properly commented for understanding easily. Comments regarding
the statements increase the understandability of the code.
- Coding guidelines increase the efficiency of the software and reduces the
development time.
- Coding guidelines help in detecting errors in the early phases, so it helps to reduce
the extra cost incurred by the software project.
- If coding guidelines are maintained properly, then the software code increases
readability and understandability thus it reduces the complexity of the code.
- It reduces the hidden cost for developing the software.
56
References
Adhikar, A. A. B. C. B., 2016. Research Gate. [Online]
Available at:
https://www.researchgate.net/publication/311587459_Object_Oriented_Programmin
g_Vs_Procedural_Programming
[Accessed 20 August 2022].
aws.amazon., 2023. aws.amazon.(What Is An IDE (Integrated Development
Environment)?). [Online]
Available at: https://aws.amazon.com/what-is/ide/
[Accessed 10 March 2023].
donkcowan, 2023. donkcowan(Big O Notation). [Online]
Available at: https://www.donkcowan.com/blog/2013/5/11/big-o-notation
[Accessed 07 March 2023].
geeksforgeeks, 2022. geeksforgeeks(Coding Standards and Guidelines). [Online]
Available at: https://www.geeksforgeeks.org/coding-standards-and-guidelines/
[Accessed 10 March 2023].
geeksforgeeks, 2022. geeksforgeeks(geeksforgeeks). [Online]
Available at: https://www.geeksforgeeks.org/introduction-of-programming-
paradigms/
[Accessed 09 March 2023].
geeksforgeeks, 2022. geeksforgeeks(Introduction of Programming Paradigms). [Online]
Available at: https://www.geeksforgeeks.org/introduction-of-programming-
paradigms/
[Accessed 08 March 2023].
Gillis, A. S., 2022. techtarget(algorithm). [Online]
Available at: https://www.techtarget.com/whatis/definition/algorithm
[Accessed 07 March 2023].
Heusser, M., 2022. techtarget(techtarget). [Online]
Available at: https://www.techtarget.com/searchsoftwarequality/definition/debugging
[Accessed 10 March 2023].
interviewbit, 2022. interviewbit(Top Characteristics of Object Oriented Programming).
[Online]
Available at: https://www.interviewbit.com/blog/characteristics-of-object-oriented-
programming/
[Accessed 09 March 2023].
javatpoint, 2023. javatpoint(Software Development Life Cycle (SDLC)). [Online]
Available at: https://www.javatpoint.com/software-engineering-software-
development-life-cycle
[Accessed 08 March 2023].
javatpoint, 2023. javatpoint(What is programming?). [Online]
Available at: https://www.javatpoint.com/what-is-programming
[Accessed 08 March 2023].
57
javatpoint, 2023. javatpoint(What is programming?). [Online]
Available at: https://www.javatpoint.com/what-is-programming
[Accessed 08 March 2023].
Martin, M., 2023. guru99(Software Development Life Cycle (SDLC) Phases & Models).
[Online]
Available at: https://www.guru99.com/software-development-life-cycle-tutorial.html
[Accessed 08 March 2023].
Mulongo, C., 2022. technotification(The Importance Of Algorithms In Computer
Programming). [Online]
Available at: https://www.technotification.com/2019/02/importance-of-algorithms-
programming.html
[Accessed 08 March 2023].
Premiumpapers, 2022. Premium papers. [Online]
Available at: https://premium-papers.com/object-oriented-and-event-driven-
programming-versus-procedural/
[Accessed 20 August 2022].
premium-papers, 2022. premium-papers(Object-Oriented and Event-Driven
Programming versus Procedural). [Online]
Available at: https://premium-papers.com/object-oriented-and-event-driven-
programming-versus-procedural/
[Accessed 09 March 2023].
RishabhPrabhu, 2023. https://www.geeksforgeeks.org/introduction-to-algorithms/.
[Online]
Available at: https://www.geeksforgeeks.org/introduction-to-algorithms/
[Accessed 17 January 2023].
salman, 2023. salfarisi25(Expert Wannabe). [Online]
Available at: https://salfarisi25.wordpress.com/2010/12/22/advantage-and-
disadvantage-of-using-ide/
[Accessed 10 March 2023].
Shah, R., 2021. benchpartner. [Online]
Available at: https://benchpartner.com/advantages-and-disadvantages-of-event-
driven-programming
[Accessed 15 August 2022].
Tawde, S., 2022. educba(What is Debugging?). [Online]
Available at: https://www.educba.com/what-is-debugging/
[Accessed 10 March 2023].
Tawde, S., 2022. educba(What is Debugging?). [Online]
Available at: https://www.educba.com/what-is-debugging/
[Accessed 10 March 2023].
UKEssays, 2021. UKEssays. [Online]
Available at: https://www.ukessays.com/essays/computer-science/eventdriven-
programming-features-6167.php
[Accessed 15 August 2022].
ukessays, 2021. ukessays(Event-Driven Programming Features). [Online]
Available at: https://www.ukessays.com/essays/computer-science/eventdriven-
58
programming-features-6167.php
[Accessed 09 March 2023].
ukessays, 2021. ukessays(Introduction to Event-driven programming). [Online]
Available at: https://www.ukessays.com/essays/computer-science/eventdriven-
programming-features-6167.php
[Accessed 09 March 2023].
Vladimir, G., 2021. blog.garybricks(Efficiency and Big-O Notation Overview with Python
Examples). [Online]
Available at: https://blog.garybricks.com/efficiency-and-big-o-notation-overview-with-
python-examples#heading-what-is-it
[Accessed 07 March 2023].
Waraich, K., 2023. codingninjas(Difference Between Procedural and Object Oriented
Programming). [Online]
Available at: https://www.codingninjas.com/codestudio/library/difference-procedural-
-object-oriented-programming
[Accessed 09 March 2023].
59