0% found this document useful (0 votes)
40 views

Programming Assigment New

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Programming Assigment New

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Higher Nationals

Internal verification of assessment decisions – BTEC (RQF)


INTERNAL VERIFICATION – ASSESSMENT DECISIONS

Programme title Higher National Diploma in Computing

Mr. Lasitha Ranawaka


Assessor Internal Verifier
Unit 01
Unit(s)
Design &Implement a GUI based system using a suitable Integrated Development
Assignment title
Environment
H M A M Jayathilake
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
Y/N
accurately?
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
Y/N
amending?

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
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.

Pass, Merit & Distinction Descripts P1 M1 D1

LO2. Explain the characteristics of procedural, object-orientated and event-driven programming, conduct an analysis of a suita
Integrated Development Environment (IDE).

Pass, Merit & Distinction Descripts P2 M2 D2

LO3. Implement basic algorithms in code using an IDE.

Pass, Merit & Distinction Descripts P3 M3 D3

LO4. Determine the debugging process and explain the importance of a coding standard.
Pass, Merit & Distinction Descripts P4 P5 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 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.

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: [email protected] Date: 10-03-2023


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

Unit Number and Title Unit 01: Programming

Academic Year 2021/22

Unit Tutor Mr. Lasitha Ranawaka

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


Integrated Development Environment

Issue Date 09-01-2023

Submission Date 10-03-2023

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.

Fn = 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. 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.

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

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 register employee details to the system (including


monthly salary, overtime rates-hourly, allowances).

• 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,

Base Pay (Monthly Salary: salary_cycle_date_range, eg: 30 days): Each


employee will be paid monthly

If any employee couldn’t cover salary_cycle_date_range (eg:-30 days) attendance


the system should calculate the no-pay value according to the below mention
formula,

No-pay-value = (Total_Salary/salary_cycle_date_range)
*No_of_absent_days

Base Pay need to calculate according to the below mentioned formula

Base Pay value = Monthly_Salary + Allowances +


(Over_time_rate*no_of_overtime_hours)
Gross Pay need to calculate according to the below mentioned formula

Gross Pay = Base_Pay_value – (No_pay_value +


Base_Pay_value*government_tax_rate)

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

ii. Salary cycle begin date

iii. Salary cycle end date

iv. No of leaves for an employee for a year.

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

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.
Name - H M AM Jayathilake

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

Figure 01 – What is an Algoritham (RishabhPrabhu, 2023)........................................................................... 1

Figure 02 – Big O Notation Summary (donkcowan, 2023). ............................................................................ 9

Figure 03 – Python code for Fibonacci Series .............................................................................................. 10

Figure 04 – Python code result for Fibonacci Series .................................................................................... 11

Figure 05 - Python code for Factorial Value ................................................................................................ 11

Figure 06 - Python code result for Factorial Value ...................................................................................... 12

Figure 07-SLDC Phases (javatpoint, 2023). ................................................................................................. 12

Figure 08 – Programing Paradigms Types (javatpoint, 2023). .................................................................... 17

Figure 09 – procedural programming ........................................................................................................... 20

Figure 10 – Object-oriented programming ................................................................................................... 22

Figure 11 – Event - Driven Paradigms ......................................................................................................... 25

Figure 12 – Login Form ................................................................................................................................ 36

Figure 13– Main Page................................................................................................................................... 37

Figure 14– Employee Registration ................................................................................................................ 38

Figure 15– Employee Salary ......................................................................................................................... 39

Figure 17– Employee Leave Maintenances ................................................................................................... 40

Figure 18– Login Maintenances.................................................................................................................... 41

Figure 19 – OT and Allowance Maintenances .............................................................................................. 42

Figure 20 – Grifindor Database .................................................................................................................... 43

Figure 21 – Employee Registration ............................................................................................................... 44

Figure 22 – Leave Table................................................................................................................................ 44

Figure 23 – Employee Registration -Detail Add- Successful ........................................................................ 45

Figure 24 – Employee Registration - code .................................................................................................... 45

Figure 25 – Employee Registration -Details update ..................................................................................... 46

Figure 26 – Employee Registration -Details update-Code............................................................................ 46

Figure 27 – Employee Registration -Details Delete-Success ........................................................................ 47

Figure 28 – Employee Registration - Details Delete-Code ........................................................................... 47

Figure 29 – Base pay Value Calculation -Code ............................................................................................ 48

Figure 30 – No Pay and Gross Pay Calculation -Code ................................................................................ 48

Figure 31 - debugging process (Tawde, 2022). ........................................................................................... 49


1.0 Task 01

1.1 What is an Algorithm

An algorithm is a procedure used for solving a problem or performing a computation. In


computer programming terms, an algorithm is a set of well-defined instructions to solve a
particular problem. It takes a set of input(s) and produces the desired output.

Figure 01 – What is an Algoritham (RishabhPrabhu, 2023)

Algorithms can be expressed as natural languages, programming languages, pseudocode,


flowcharts and control tables. Natural language expressions are rare, as they are more
ambiguous. Programming languages are normally used for expressing algorithms
executed by a computer.
Algorithms use an initial input along with a set of instructions. The input is the initial data
needed to make decisions and can be represented in the form of numbers or words. The
input data gets put through a set of instructions, or computations, which can include
arithmetic and decision-making processes. The output is the last step in an algorithm and
is normally expressed as more data (Gillis, 2022).

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

1. Clear and Unambiguous


2. Independent
3. Input
4. Output
5. Finiteness
6. Effectiveness

1. Clear and Unambiguous


The algorithm must be clear and unambiguous. All steps should be clear in all aspects and
must lead to only one meaning.

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.

1.1.2 Different type of Algorithm

There are several types of algorithms, all designed to accomplish different tasks. For
example, algorithms perform the following:

Search engine algorithm


This algorithm takes strings of keywords and operators as input, searches its associated
database for relevant webpages and returns results.
Encryption algorithm
This computing algorithm transforms data according to specified actions to protect it. A
symmetric key algorithm, such as the Data Encryption Standard, for example, uses the
same key to encrypt and decrypt data. As long as the algorithm is sufficiently
sophisticated, no one lacking the key can decrypt the data.
Greedy algorithm
This algorithm solves optimization problems by finding the locally optimal solution,
hoping it is the optimal solution at the global level. However, it does not guarantee the
most optimal solution.
Recursive algorithm
This algorithm calls itself repeatedly until it solves a problem. Recursive algorithms call
themselves with a smaller value every time a recursive function is invoked.
Backtracking algorithm
This algorithm finds a solution to a given problem in incremental approaches and solves
it one piece at a time.
Divide-and-conquer algorithm
This common algorithm is divided into two parts. One part divides a problem into
smaller subproblems. The second part solves these problems and then combines them
together to produce a solution.

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.

1.2. How to use Pseudo Code in Algorithm

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.

1.2.1 Pseudo code for Fibonacci Series

A series of numbers in which each number is the sum of the two preceding or previous
numbers is called Fibonacci Series.

For example, Fibonacci series up to 6 numbers is 1, 1, 2, 3, 5, 8, etc.

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

So, if a user Enters 5, then n=5,

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

When the user assigns a value for n, as n = 7,

Iteration (i) i <=n Value of Value of “b” Value of “c” Output


“a”

Initial 0 1 01

1st Iteration True 0 1 1 011

2nd Iteration True 1 1 2 0112

3rd Iteration True 1 2 3 01123

4th Iteration True 2 3 5 011235

5th Iteration False - - - 011235

1.2.2 Pseudo code for Factorial Value

The factorial of a non-negative integer n, denoted by n!, is the product of all positive
integers less than or equal to n.

For example, 5! = 1×2×3 ×4 ×5 = 120.


Factorial of any number n is denoted as n! and is equal to
n! = 1 x 2 x 3 x ... x (n – 2) x (n – 1) x 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

The value of F will be the factorial of N(number).

If the user assign value for n as, n = 7,

Iteration i <= n Value of “x” Value of “y” Output

Initial

1st Iteration True 6 42 42

2nd Iteration True 5 210 210

3rd Iteration True 4 840 840

4th Iteration True 3 2520 2520

5th Iteration True 2 5040 5040

6th Iteration True 1 5040 5040

7th Iteration False 0 - 5040

1.3 Big O Notation

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.

Figure 02 – Big O Notation Summary (donkcowan, 2023).

1.3.1 Bog O Notation role in evaluating efficiency of algorithms

The Big-O notation is a sign of an algorithm's complexity. In a nutshell, Big-O notation


shows the connection between the algorithm's input and the steps needed to run it. A
capital "O" with an opening and closing parenthesis is used to indicate it. The relationship
between the input and the algorithm's steps is shown using "n" in the parenthesis. For
instance, if the input and the final step the algorithm takes to execute are both linear, the
Big-O notation will be used (n) A similar Big-O notation is used for quadratic functions,
which is O. (n2).

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.

1.3.2 Python code for Fibonacci series

Figure 03 – Python code for Fibonacci Series

10
As an example, Fibonacci Number of 10

Figure 04 – Python code result for Fibonacci Series

1.3.2 Python code for Factorial Value

Figure 05 - Python code for Factorial Value

11
As an example, Factorial Number of 10

Figure 06 - Python code result for Factorial Value

1.4 Process of building an application

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).

Figure 07-SLDC Phases (javatpoint, 2023).

12
SDLC Phases
The entire SDLC process divided into the following SDLC steps:

- Phase 1: Requirement collection and analysis


- Phase 2: Feasibility study/Deifying
- Phase 3: Design
- Phase 4: Coding
- Phase 5: Testing
- Phase 6: Installation/Deployment
- Phase 7: Maintenance

Phase 1: Requirement collection and analysis


The requirement is the first stage in the SDLC process. It is conducted by the senior team
members with inputs from all the stakeholders and domain experts in the industry.
Planning for the quality assurance requirements and reorganization of the risks involved
is also done at this stage.
This stage gives a clearer picture of the scope of the entire project and the anticipated
issues, opportunities, and directives which triggered the project.
Requirements Gathering stage need teams to get detailed and precise requirements. This
helps companies to finalize the necessary timeline to finish the work of that system
(Martin, 2023).

Phase 2: Feasibility study


Once the requirement analysis phase is completed the next SDLC step is to define and
document software needs. This process conducted with the help of ‘Software
Requirement Specification’ document also known as ‘SRS’ document. It includes
everything which should be designed and developed during the project life cycle (Martin,
2023).

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).

1.5 Steps taken from writing to executing a code.

Program development is the process of creating application programs. Program


development life cycle (PDLC) The process containing the five phases of program
development: analyzing, designing, coding, debugging and testing, and implementing and
maintaining application software.
The following are six steps in the Program Development Life Cycle:
1. Analyze the problem
The computer user must figure out the problem, then decide how to resolve the
problem - choose a program.
2. Design the program
A flow chart is important to use during this step of the PDLC. This is a visual
diagram of the flow containing the program. This step will help you break down
the problem.
3. Code the program
This is using the language of programming to write the lines of code. The code is
called the listing or the source code. The computer user will run an object code for
this step.
4. Debug the program
The computer user must debug. This is the process of finding the "bugs" on the
computer. The bugs are important to find because this is known as errors in a
program.
5. Formalize the solution
One must run the program to make sure there are no syntax and logic errors.
Syntax are grammatical errors and logic errors are incorrect results.
6. Document and maintain the program
This step is the final step of gathering everything together. Internal
documentation is involved in this step because it explains the reasoning one might

15
have made a change in the program or how to write a program

1.5.1 Computer Programing and Coding

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.

1.5.2 Importance of Algorithms

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;

- To predict the behavior of an algorithm without implementing it on a specific


computer.
- It is much more convenient to have simple measures for the efficiency of an
algorithm than to implement the algorithm and test the efficiency every time a
certain parameter in the underlying computer system changes.
- It is impossible to predict the exact behavior of an algorithm. There are too many
influencing factors.
- The analysis is thus only an approximation; it is not perfect.
- More importantly, by analyzing different algorithms, we can compare them to
determine the best one for our purpose.

16
2.0 Task 02

2.1 Programming Paradigm

Programming paradigms are different ways or styles in which a given program or


programming language can be organized. Each paradigm consists of certain structures,
features, and opinions about how common programming problems should be tackled.

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).

Figure 08 – Programing Paradigms Types (javatpoint, 2023).

2.1.1 Type of Paradigm

There is the following two programming paradigm:


1. Imperative Programming Paradigm
2. Declarative Programming Paradigm

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.

Types of Imperative Programming Paradigm


There are the following types of imperative programming paradigms:
1. Procedural Programming
2. Object-oriented Programming
3. Parallel Processing Approach

2. Declarative Programming Paradigm


It is divided as Logic, Functional, Database. In computer science the declarative
programming is a style of building programs that expresses logic of computation without
talking about its control flow. It often considers programs as theories of some logic. It
may simplify writing parallel programs. The focus is on what needs to be done rather how
it should be done basically emphasize on what code is actually doing. It just declares the
result we want rather how it has been produced. This is the only difference between
imperative (how to do) and declarative (what to do) programming paradigms. Getting
into deeper we would see logic, functional and database (geeksforgeeks, 2022).

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

Types of Declarative Programming Paradigm


There are the following types of imperative programming paradigms:
- Logic programming.
- Functional programming.
- Data-driven programming.

2.2 Procedural 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.

Figure 09 – procedural programming

2.2.1 Characteristics of procedural programming

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’.

Advantages of Procedural Programming


- Procedural Programming is excellent for general-purpose programming
- The coded simplicity along with ease of implementation of compilers and
interpreters
- A large variety of books and online course material available on tested algorithms,
making it easier to learn along the way
- The source code is portable, therefore, it can be used to target a different CPU as
well
- The code can be reused in different parts of the program, without the need to copy
it
- Through Procedural Programming technique, the memory requirement also
slashes
- The program flow can be tracked easily

Disadvantages of Procedural Programming


- The program code is harder to write when Procedural Programming is employed
- The Procedural code is often not reusable, which may pose the need to recreate

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

2.3 Object-oriented Programming

The object-oriented programming paradigm is based on the concept of object. An object


contains data in the form of fields that are known as attributes and the procedures are
known as methods. Since objects work independently, they are encapsulated into
modules. we can communicate with an object by using message passing(javatpoint,
2023).

Object-oriented programming can be achieved by using programming languages such


as Java, C++, C#, PHP, and Python, etc.

Figure 10 – Object-oriented programming

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).

Advantages of Object-oriented Programming


- Due to modularity and encapsulation, OOP offers ease of management

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

2.4 Event - Driven Paradigms

Event-driven programming known as a computer programming paradigm that used the


occurrence of events to determine the control flow of the program. This type of
application is designed to detect events as they occur, and use an appropriate event-
handling procedure to deal with it, which normally use a callback function or method.
Theoretically, event-driven style of programming is supported in all programming
languages, but they may different in the way of implement it, for example, it’s easier to
implement in languages that provide high-level abstractions, such as closures. Besides,
for other programming environments such as Adobe Flash, they are specifically tailored
for triggering program code by events (ukessays, 2021).

Figure 11 – Event - Driven Paradigms

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).

Advantages of event driven paradigm


- Simple and understandable.
- Flexible as code and design can be altered easily of faults occur.

26
- Simplicity of programming
- Allows hardware and sensors to interact with software.
- Allow interactive programs

Disadvantages of event driven paradigm.


- Very complex
- Difficulty in finding an error.
- Slower execution if RAM is insufficient.
- Less logical

2.5 Procedural programming vs Object oriented programming

The objective of procedural programming is to break down a program into a collection of


variables, data structures whereas the main aim of object-oriented programming is to
break down a programming task into objects. In simple words, procedural programming
uses procedures to operate on data structures, while object-oriented uses objects for the
purpose (Waraich, 2023).
In both programming paradigms, the nomenclature is different though have similar
semantics:

Procedural Programming Object-oriented Programming

Procedure Method

Record Object

Module Class

Procedure call Message

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.

Procedural Programming Object-oriented Programming

It focuses on the process and functions. It focuses on the data and classes.

It is not easy to maintain. It is easy to maintain.

In this paradigm, if a sub-procedure has to In this paradigm, it is easy to maintain


be modified, it becomes difficult to find code and modify existing code.

28
and maintain it.

Due to its complexity, development time Due to easy maintenance, development


increases. time reduces.

Procedural programming languages are not The object-oriented programming


as faster as object-oriented. languages are faster and more effective.

Procedural uses procedures, modules, Object-oriented uses objects, classes,


procedure calls. messages.

It focuses on procedure rather data which It focuses on data rather than procedures.
has priority in data-driven systems.

In procedural programming, designs In object-oriented programming, designs


cannot be reused and recycled throughout can be reused throughout the program.
the program.

While solving issues in procedural In object-oriented programming, objects


programming, issues need to be addressed and classes can be referenced throughout
individually. the program.

Data hiding is not possible. Data hiding is possible, hence more secure
than procedural.

Operator overloading is not allowed. In OOP, operator overloading is allowed.

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.

2.6. Object oriented programming vs Event driven programming

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).

Object Oriented Programming


Event Driven Programming Paradigm
Paradigm

Provides graphical user interface to create the


Provides command writing in modules.
programs.

Actions are defined on events. These events could


Objects and functions are prepared for
be occurred by mouse clicking and moving or
interaction to perform specific tasks.
keyboard strokes.

Focuses on objects or data and


Focuses on selecting user interface. facilitate to secure it from unauthorized
access.

Most common languages which follow


Most common languages which follow this
this paradigm are Smalltalk, C++ and
paradigm are Visual Basic and C#.
JAVA.

30
3.0 Task 03

3.1 Integration Development Environment (IDE)

An integrated development environment (IDE) is a software application that helps


programmers develop software code efficiently. It increases developer productivity by
combining capabilities such as software editing, building, testing, and packaging in an
easy-to-use application. Just as writers use text editors and accountants use spreadsheets,
software developers use IDEs to make their job easier (aws.amazon., 2023).

Examples for IDEs


- NetBeans
- Microsoft Visual Studio
- Adobe Flex Builder
- Eclipse

3.1.1 Important of IDE

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.

3.1.2 Type of IDE

Integrated development environments (IDEs) can be broadly classified into several


different categories, depending on the application development they support and how
they work. However, many IDE software applications can fit into multiple categories.
The following are some types of IDEs:

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.

02. Cloud IDEs


Developers use cloud IDEs to write, edit, and compile code directly in the browser so that
they don't need to download software on their local machines. Cloud-based IDEs have
several advantages over traditional IDEs.

3.1.3 Advantage of IDEs

Standardized development environment


Software development teams can centrally configure a cloud-based IDE to create a
standard development environment. This method helps them avoid errors that might
occur due to local machine configuration differences.
Platform independence
Cloud IDEs work on the browser and are independent of local development
environments. This means they connect directly to the cloud vendor's platform, and
developers can use them from any machine.
Better performance
Building and compiling functions in an IDE requires a lot of memory and can slow down
the developer's computer. The cloud IDE uses compute resources from the cloud and
frees up the local machine’s resources.

Less time and effort


The entire purpose of an IDE is to make developing faster and easier. Its tools and

33
features are supposed to help you organize resources, prevent mistakes, and provide
shortcuts.

Enforce project or company standards


Simply by working in the same development environment, a group of programmers will
adhere to a standard way of doing things. Standards can be further enforced if the IDE
offers predefined templates, or if code libraries are shared between different team
members/teams working on the same project.

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).

3.1.4 Disadvantages of the IDEs

Learning curve
IDEs are complicated tools. Maximizing their benefit will require time and patience.

A sophisticated IDE may not be a good tool for beginning programmers


If you throw the learning curve of an IDE on top of learning how to program, it can be
quite frustrating. Further, features and shortcuts for experienced programmers often hide
crucial but mundane details of a language. Details should not be overlooked when
learning a new language. Using an IDE may hamper the learning of a new language.

Will not fix bad code, practices, or design


You still need to be proficient and meticulous. An IDE will not eliminate efficiency or
performance problems in your application. IDEs are like paintbrushes. Whether you
create a Van Gogh or a Velvet Elvis is dictated by your skill and decisions (salman,
2023).

34
3.2 Application developed using Visual studio For Grifindo Toys Company

Visual Studio is an integrated development environment (IDE) from Microsoft. It is used


to develop computer programs including websites, web apps, web services and mobile
apps. Visual Studio uses Microsoft software development platforms such as Windows
API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft
Silverlight. It can produce both native code and managed code.
Visual Studio includes a code editor supporting IntelliSense (the code completion
component ) as well as code refactoring. The integrated debugger works as both a
source-level debugger and as a machine-level debugger. Other built-in tools include
a code profiler, designer for building GUI applications, web designer, class designer,
and database schema designer. It accepts plug-ins that expand the functionality at almost
every level—including adding support for source control systems (like Subversion and
Git) and adding new toolsets like editors and visual designers for domain-specific
languages or toolsets for other aspects of the software development lifecycle

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.

Figure 12 – Login Form

36
Home Page

After the login, home page is the next interface appear.

Figure 13– Main 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.

Figure 14– Employee Registration

38
Employee Salary

In this interface user can calculate the monthly salary using their salary parameters.

Figure 15– Employee Salary

39
Employee Leave Maintenance

In this interface user can maintenance the leaves of their employees

Figure 17– Employee Leave Maintenances

40
Employee Login Maintenance

In this interface user can maintenance the user login and their levels

Figure 18– Login Maintenances

41
Employee Login Maintenance

In this interface user can maintenance the user login and their levels

Figure 19 – OT and Allowance Maintenances

42
3.2.2 Database for Grifindor Toy Company

Created database for Grifindo Toys

Figure 20 – Grifindor Database

43
Employee Registration Table

Figure 21 – Employee Registration

Leave Table

Figure 22 – Leave Table

44
3.2.1 Programing code and Successful massages

Insert data to Employee Registration Table

Figure 23 – Employee Registration -Detail Add- Successful

Figure 24 – Employee Registration - code

45
Update employee table data

Figure 25 – Employee Registration -Details update

Figure 26 – Employee Registration -Details update-Code

46
Delete Data from Employee table

Figure 27 – Employee Registration -Details Delete-Success

Figure 28 – Employee Registration - Details Delete-Code

47
Code for salary calculation

Base Pay Value calculation

Figure 29 – Base pay Value Calculation -Code

No Pay Value calculation and Gross Pay

Figure 30 – No Pay and Gross Pay Calculation -Code

48
4.0 Task

4.1 Debugging

Debugging in computer programming and engineering, is a multistep process that


involves identifying a problem, isolating the source of the problem and then either
correcting the problem or determining a way to work around it. The final step of
debugging is to test the correction or workaround and make sure it works.
In software development, the debugging process begins when a developer locates
a code error in a computer program and is able to reproduce it. Debugging is part of
the software testing process and is an integral part of the entire software development
lifecycle.
In hardware development, the debugging process looks for hardware components that are
not installed or configured correctly (Heusser, 2022).

Figure 31 - debugging process (Tawde, 2022).

4.1.1 Process of 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).

Below is the list of stages involved in the process of debugging


1. Identify Error
Identifying errors at an early stage can save a lot of time. If we make a mistake in
identifying an error, it leads to a lot of time wastage. Error or bugs occur at a customer
site is hard to find. Identifying the right error is import to save time and avoid errors at
the user site.
2. Identify the Error Location
After identifying an error, we need to identify the exact location in the code where an
error occurs. Identifying an exact location that leads error can help to fix the problem
faster.
3. Analyze Error
In this stage, you have to use an appropriate approach to analyze the error. This will help
you to understand the problem. This stage is very critical as solving one error may lead to
another error.
4. Prove the Analysis
Once the identified error has been analyzed, you have to focus on other errors of the
software. This process involves test automation where you need to write the test cases
through the test framework.
5. Cover Lateral Damage
In this stage, you have to do unit testing of all the code where you make the changes. If
all test cases pass the test, then you can move to the next stage or else you have to resolve
the test case that doesn’t pass the test.
Fix and validate: this is the final stage of the debugging process, where you need to fix all
the bugs and test all test script.

50
4.1.2 Advantages of Debugging

- Below is the list of debugging advantages


- Saves Time: Performing debugging at the initial stage saves the time of software
developers as they can avoid the use of complex codes in software development. It not
only saves the time of software developers but also saves their energy.
- Reports Errors: It gives error report immediately as soon as they occur. This
allows the detection of error at an early stage and makes the software development
process a stress free.
- Easy Interpretations: It provides easy interpretations by providing more
information about data structures. Release bug-free software: By finding errors in
software, it allows developers to fix them before releasing them and provides bug-free
software to the customers.

4.1.3 Various Debugging Tools

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.

Some of the debugging tools are listed below.


1. GDB (the GNU debugger)
2. LLDB
3. Radare2
4. Microsoft visual studio debugger
5. Valgrind
6. WinDBg
7. Firefox JavaScript debugger
8. Eclipse debugger
9. Arm DTT (Allinea DDT)
10. WDW (OpenWatcom debugger)

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.

4.2. Coding Standers

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).

4.2.1 Purpose of Having Coding Standards:

- A coding standard gives a uniform appearance to the codes written by different


engineers.
- It improves readability, and maintainability of the code and it reduces complexity
also.
- It helps in code reuse and helps to detect error easily.
- It promotes sound programming practices and increases efficiency of the
programmers.

53
Some of the coding standards are given below:

Limited use of global:


These rules tell about which types of data that can be declared global and the data that
can’t be.

Standard headers for different modules:


For better understanding and maintenance of the code, the header of different modules
should follow some standard format and information. The header format must contain
below things that is being used in various companies:
- Name of the module
- Date of module creation
- Author of the module
- Modification history
- Synopsis of the module about what the module does
- Different functions supported in the module along with their input output
parameters
- Global variables accessed or modified by the module

Naming conventions for local variables, global variables, constants and functions:

Some of the naming conventions are given below:


- Meaningful and understandable variables name helps anyone to understand the
reason of using it.
- Local variables should be named using camel case lettering starting with small
letter (e.g. localData) whereas Global variables names should start with a capital letter
(e.g. GlobalData). Constant names should be formed using capital letters only
(e.g. CONSDATA).
- It is better to avoid the use of digits in variable names.
- The names of the function should be written in camel case starting with small

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.

Error return values and exception handling conventions:


All functions that encountering an error condition should either return a 0 or 1 for
simplifying the debugging.
On the other hand, Coding guidelines give some general suggestions regarding the coding
style that to be followed for the betterment of understandability and readability of the
code. Some of the coding guidelines are given below :

Avoid using a coding style that is too difficult to understand:


Code should be easily understandable. The complex code makes maintenance and
debugging difficult and expensive.

Avoid using an identifier for multiple purposes:


Each variable should be given a descriptive and meaningful name indicating the reason
behind using it. This is not possible if an identifier is used for multiple purposes and thus
it can lead to confusion to the reader. Moreover, it leads to more difficulty during future
enhancements.

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.

Length of functions should not be very large:


Lengthy functions are very difficult to understand. That’s why functions should be small
enough to carry out small work and lengthy functions should be broken into small ones
for completing small tasks.

Try not to use GOTO statement:


GOTO statement makes the program unstructured, thus it reduces the understandability of
the program and also debugging becomes difficult.

4.2.2 Advantages of Coding Guidelines:

- 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

You might also like