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

Programing

The document discusses an internal verification of assessment decisions for a Higher National Diploma in Computing program. It includes forms for the assessor and internal verifier to track a student's assignment, providing feedback. It outlines the assignment requirements and expectations for students to design and implement a GUI system using an integrated development environment.

Uploaded by

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

Programing

The document discusses an internal verification of assessment decisions for a Higher National Diploma in Computing program. It includes forms for the assessor and internal verifier to track a student's assignment, providing feedback. It outlines the assignment requirements and expectations for students to design and implement a GUI system using an integrated development environment.

Uploaded by

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

Higher Nationals

Internal verification of assessment decisions – BTEC (RQF)


INTERNAL VERIFICATION – ASSESSMENT DECISIONS

Programme title Higher National Diploma in Computing

Assessor Internal Verifier

Unit(s)

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

INTERNAL VERIFIER CHECKLIST

Do the assessment criteria awarded match


those shown in the assignment brief? Y/N

Is the Pass/Merit/Distinction grade awarded


justified by the assessor’s comments on the Y/N
student work?
Has the work been assessed accurately?
Y/N
Is the feedback to the student:
Give details:
• Constructive?
• Linked to relevant assessment criteria?
• Identifying opportunities for improved Y/N Y/N
performance? Y/N
Y/N
• Agreeing actions?
Does the assessment decision need amending?
Y/N

Assessor signature Date

Internal Verifier signature Date

Programme Leader signature (if required)


Date

Confirm action completed

THANUSHA SIVAYOGARAJA 1
Remedial action taken

Give details:

Assessor signature Date


Internal Verifier
signature Date
Programme Leader
signature (if required) Date

Higher Nationals - Summative Assignment Feedback Form


Student Name/ID THANUSHA/E184566
Unit Title
Assignment Number Assessor

THANUSHA SIVAYOGARAJA 2
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
driven programming, conduct an
LO2. Explain the characteristics of procedural, object-orientated and event- analysis
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

THANUSHA SIVAYOGARAJA 3
Formative Feedback: Assessor to Student

Action Plan

Summative feedback

Feedback: Student to Assessor

Assessor Date
signature

Student Date
signature

THANUSHA SIVAYOGARAJA 4
Pearson Higher Nationals in
Computing
Unit 01: Programming Assignment
01

THANUSHA SIVAYOGARAJA 5
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.

THANUSHA SIVAYOGARAJA 6
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.

[email protected]
Student’s Signature: Date: 14/11/2023
(Provide E-mail ID) (Provide Submission Date)

THANUSHA SIVAYOGARAJA 7
Higher National Diploma in Computing
Assignment Brief
Student Name /ID Number THANUSHA/E184566

Unit Number and Title Unit 01: Programming

Academic Year 2021/22

Unit Tutor

Assignment Title
Design &Implement a GUI based system using a suitable
Integrated Development Environment

Issue Date

Submission Date

IV Name & Date

Submission Format

THANUSHA SIVAYOGARAJA 8
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

THANUSHA SIVAYOGARAJA 9
Assignment Brief and Guidance:

THANUSHA SIVAYOGARAJA 10
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

THANUSHA SIVAYOGARAJA 11
2.1 Compare and discuss what is meant by a Programming Paradigm and the main
characteristics of Procedural , Object oriented and Even t -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 hir ed 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).

THANUSHA SIVAYOGARAJA 12
• 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

THANUSHA SIVAYOGARAJA 13
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-
payvalue, 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

THANUSHA SIVAYOGARAJA 14
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.

THANUSHA SIVAYOGARAJA 15
THANUSHA SIVAYOGARAJA 16
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
eventdriven paradigms, in terms of the code structure and
characteristics.

THANUSHA SIVAYOGARAJA 17
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.

THANUSHA SIVAYOGARAJA 18
Contents
Activity 1 ................................................................................................................................. 21
ALGORITHMS ....................................................................................................................... 21
Characteristics of ALGORITHM ............................................................................................. 22
Algorithms to display the Fibonacci series and the factorial value using Pseudo code. ......... 22
Fibonacci series ........................................................................................................................ 22
Algorithms to display the Fibonacci series using Pseudo code ............................................... 23
Algorithms to display the factorial value using Pseudo code .................................................. 23
Steps involved in the process of writing and executing a program ......................................... 24
Dry run on the algorithm of Fibonacci series. ......................................................................... 24
Big-O notation ......................................................................................................................... 25
This is how it goes: .................................................................................................................. 25
A table summarizing Big O functions may be seen below. The four that are most frequently
mentioned and crucial to keep in mind are: ............................................................................. 26
Python code to display the Fibonacci series ............................................................................ 27
Python code to display the Factorial Value .............................................................................. 27
Activity 2 ................................................................................................................................. 28
what is Programming Paradigm. .............................................................................................. 28
Common Programming Paradigms are: ................................................................................... 28
Imperative Programming (Procedural Programming) ............................................................. 28
Features of Procedure-Based Programming ............................................................................ 28
Declarative Programming Paradigm ........................................................................................ 28
Functional Programming Paradigm ......................................................................................... 29
Object Oriented Programming ................................................................................................. 29
Key characteristic of OOP: ...................................................................................................... 29
Event-driven Programming ...................................................................................................... 29
Key Features of Event-Driven Programming: ......................................................................... 29
These programming paradigms have many relationships. Such as: ........................................ 30
Small snippets of code as example for the above three programming paradigms ................... 30
Small snippets of code for object-oriented programming paradigm ....................................... 31
Small snippets of code for object-oriented programming paradigm ....................................... 31
Small snippets of code for Event driven programming paradigm ........................................... 32
Analyzing with a critical eye the code examples provided for object-oriented programming 32
Activity 3 ................................................................................................................................. 33
THANUSHA SIVAYOGARAJA 19
3.1. Pseudocode for Salary....................................................................................................... 33
GUI for Above Salary Component .......................................................................................... 36
3.2 Design the Database Structure for Payroll System ............................................................ 37
3.3. IDE features and evaluate how its help for application developer. ................................... 38
How IDE features help application developer ......................................................................... 38
Activity 4 ................................................................................................................................. 39
4.1. Design and Build GUI for Gryffindor Pay Roll System. .................................................. 39
Login Page ............................................................................................................................... 39
Main Menu ............................................................................................................................... 40
Employee Menu ....................................................................................................................... 41
Register Employee ................................................................................................................... 43
Update Employee ..................................................................................................................... 44
Delete Employee ...................................................................................................................... 45
Salary Menu ............................................................................................................................. 46
Employee month Salary ........................................................................................................... 47
Salary Report Per Month ......................................................................................................... 49
Salary Setting ........................................................................................................................... 51
4.2. Debugging Process and Debugging Facilities in IDE....................................................... 55
4.3. Explain Coding standards for Payroll System. ................................................................. 56

THANUSHA SIVAYOGARAJA 20
Activity 1

ALGORITHMS
A set of instructions for completing a task or solving an issue is called an algorithm.
Algorithms are an essential part of computer science, used in everything from simple
calculations to complex data processing jobs.
Algorithms perform a wide range of tasks, such as data sorting, information searching, and
calculation. They are an essential component of computer systems and are used to do certain
tasks or deal with specific problems.

A sequence of consecutive steps that receive an input, process it, and output the results is
commonly referred to as an algorithm. A text string, an integer collection, or any other type of
data might be used as the input. The result of the algorithm's processing of the input is called
the output.
Numerous computer languages may be used to generate both simple and complex algorithms.
The following characteristics of a good algorithm are typically desirable: simplicity,
scalability, efficacy, and accuracy.
Algorithms are an essential component of computer science and programming; they are
collections of instructions for carrying out tasks or finding solutions to problems.

THANUSHA SIVAYOGARAJA 21
Characteristics of ALGORITHM

•Effectiveness - With the resources at hand, it should be doable.


•Independent - It should have step-by-step directions.
•Input - ALGORITHM must include inputs.
•Output - It should have one or more outputs.
•Unambiguous – ALGORITHM must convey a single meaning. Each step must be distinct.

Algorithms to display the Fibonacci series and the factorial value using
Pseudo code.

Fibonacci series
A collection of integers known as the Fibonacci numbers, or the Fibonacci sequence, begins
at 0 and goes through 1, 1, 1, and then a string of ever-increasing numbers. For each number
in the sequence, the total of the two numbers that came before it is the same.

THANUSHA SIVAYOGARAJA 22
Algorithms to display the Fibonacci series using Pseudo code

Pseudocode for Fibonacci Series up to n numbers:-


Step 1 Start

Step 2 Input Value of n

Step 3 X = 0, Y = 1, Z = 2

Step 4 Print X, Y

Step 5 IF (Z >n) then go to step 12

Step 6 F=X+Y
Step 7 Print F

Step 8 X=Y

Step 9 Y=F

Step 10 Z=Z+1

Step 11 Go to Step 4

Step 12 STOP

Algorithms to display the factorial value using Pseudo code

Step 1 Declare n and f as integer variable.

Step 2 Initialize f=1, Enter the value of n.

Step 3 Check whether n>0, if not then f=1.

Step 4 If yes then, f=f*n.

Step 5 Decrease the value of n by 1.

Step 6 Repeat step 4 and 5 until n=0Repeat step 4 and 5 until n=0

THANUSHA SIVAYOGARAJA 23
Steps involved in the process of writing and executing a program

1. Analyzing the Problem: The first step in programming is to gather the information
below. These things are essential to the programmer because they provide the
framework for organizing his code and handling unforeseen issues.
2. Algorithm design / Pseudocode - At this point, all of the instructions that must be
followed at different levels are provided. The writing style of these is simple English.
One may refer to it as a strategy.
3. Flowchart: This is a graphical tool that shows the steps or activities that need to be
followed in order to run a program. To make the stages in the second level simpler to
grasp, they are now all shown diagrammatically. Flowcharts help to simplify the
process of developing programmers by facilitating the description of reasoning and
the detection and correction of design errors.
4. Coding - At this step, the programmer writes the instructions for solving problems in
computer language. We use the data from the previous rounds to inform every stage of
the coding process. The requirements and resources that language provides determine
the language that is selected.
5. Debugging - At this stage, we remove all of the program's faults because we cannot
rule out making mistakes when developing. In this case, a manual DRY RUN program
is executed. This is done again until the program is error-free and all errors have been
removed from the system.
6. Testing - We test the program at this step by entering false data, which includes
normal, odd, and incorrect data, in order to confirm its behavior and outcome with the
given data.
7. Final output: After the software has finished all of the previously specified
procedures, it is given the TRUE DATA. Here, the programmer hopes the code will
function as planned and have positive results.
8. Documentation - For a number of reasons, most programmers skip over this step,
although it's important since it helps them address any problems that may occur with
the code.

Dry run on the algorithm of Fibonacci series.

Step n X Y F Z OUTPUT
Initial 4 0 1 1 0 0
1st iteration 1 2 2 1 1
2nd iteration 2 3 3 2 1
3rd iteration 2 5 5 3 2

THANUSHA SIVAYOGARAJA 24
4th iteration 5 8 8 4 3

Big-O notation
One way to indicate the complexity or efficiency of an algorithm is to use Big-O notation. It
establishes a limit on the number of steps an algorithm must do in proportion to the input
size.

This is how it goes:


Assume you have an algorithm that, upon receiving a list of n numbers, processes it. The
number of steps the algorithm must complete determines how long it will take to execute.
The algorithm's execution time may be represented using Big-O notation as a function of the
input size n.
If an algorithm's running time is exactly proportional to the size of the input, or more
accurately, if its running time is "linear" in the input's size, we would say that the method has
an O complexity (n).
Conversely, we would argue that the algorithm's complexity is O(n^2) if the method's running
time is proportional to the square of the input's size (or if the running time is "quadratic" in
the input's size).
Generally speaking, big-O notation helps us to understand how the execution time of an
algorithm grows with the amount of the input. It's a useful tool for comparing the efficacy of
different problem-solving techniques and assessing algorithm performance.
It is important to note that Big-O notation is a worst-case measure since it gives an upper
bound on the running time. While describing the algorithm's performance, we only take into
account the worst-case scenario, even if an algorithm's running time may be lowered in some
situations.

THANUSHA SIVAYOGARAJA 25
A table summarizing Big O functions may be seen below. The four that are
most frequently mentioned and crucial to keep in mind are:
Notation Name Description
O (1) Constant time The algorithm's execution time is not dependent on
the amount of the input.
O (log n) Logarithmic time The amount of the input has a logarithmic effect on
how long the algorithm takes to run.
O(n) Linear time The algorithm's execution time is inversely
correlated with the amount of the input.
O (n log Linear logarithmic The algorithm's execution time is a linear function
n) time of the input size's logarithm.
O(n^2) Quadratic time The algorithm's execution time is proportional to
the square of the input's size.
O(n^3) Cubic time The algorithm's execution time is inversely
proportional to the input size cube.
O(2^n) Exponential time The algorithm's execution time grows
exponentially with the size of the input.
O(n!) Factorial time The size of the input has a factorial effect on the
algorithm's execution time.

It's important to keep in mind that these are but a few examples of the numerous varieties of
Big-O notation that might be applied. A specific Big-O notation may be employed, depending
on the technique in issue and how the execution time scales with the input quantity. Big-O
notation provides an upper constraint on the running time, making it a worst-case measure.
While describing the algorithm's performance, we only take into account the worst-case
scenario, even if an algorithm's running time may be lowered in some situations.

THANUSHA SIVAYOGARAJA 26
Python code to display the Fibonacci series
n = int (input("Number of terms? "))
A=0
B=1
C=0
if n <= 0:
print ("Please enter a positive integer")

elif n == 1:
print ("Fibonacci sequence upto", n,":")
print(A)

else:
print ("Fibonacci sequence:")
while n > C:
print(A)
I=A+B
A=B
B=I
C += 1

Python code to display the Factorial


Value

num = int (input ("Enter a number: "))

f=1
if num < 0:
print ("Please enter a positive number")
elif num == 0:
print ("The factorial of 0 is 1")
else:
for i in range(1,num + 1):
f = f*i

THANUSHA SIVAYOGARAJA 27
print("The factorial of",num,"is",f)

Activity 2

what is Programming Paradigm.


A paradigm is a basic approach to computer programming. Different paradigms represent the
elements of a programme (objects, functions, variables, and constraints) in different ways and
with different ideas. The stages that comprise a computation are also described, including
assignations, evaluations, continuations, and data flows.

Common Programming Paradigms are:


✓ Object Oriented Programming Paradigm.
✓ Imperative Programming Paradigm.
✓ Functional Programming Paradigm.
✓ Event-driven Programming Paradigm.
✓ Imperative Programming Paradigm.

Imperative Programming (Procedural Programming)


Imperative programming is a paradigm for writing programmes that uses statements to
change the state of the programme. Similar to how the imperative mood is used in natural
languages to communicate directions. A mandatory programme consists of commands that
the computer must obey. In imperative programmes, the details of HOW the results are to be
achieved are outlined (where "HOW" refers to describing the inputs and how the outputs are
created).

Features of Procedure-Based Programming


✓ Data is transformed from one form to another via functions.
✓ Functions are the minor programmes that are created from larger programmes.
✓ Data flow freely across functions inside the system.
✓ The focus is on action (algorithms).
✓ Global data is shared by the majority of functions.

Declarative Programming Paradigm


Declarative programming describes a calculation's logic but leaves out its control flow. It is a
process for building computer programmes' foundation and component pieces. The objectives
of the programme are the focus of declarative programming. In declarative programming,
programmes are often seen as theories of a formal logic, and computations as deductions
within that logic space.

THANUSHA SIVAYOGARAJA 28
SQL and XSQL (XMLSQL) are a few examples.

Functional Programming Paradigm


Functional programming is a subset of declarative programming. Functions are code blocks
that are intended to act like mathematical functions under this paradigm. Functional
languages resist assigning values to variables and mostly rely on recursion.
Examples include JavaScript, Haskell, Python, LISP, and Ruby.

Object Oriented Programming


The paradigm for designing computer programmes known as "object-oriented programming,"
or OOP, is based on the concept of "objects." These "objects" can take the shape of
procedures, sometimes called fields and methods, that include both data and code.
Although there are many other types of object-oriented programming languages, the most
popular ones are class-based, in which objects are instances of classes that often also define
their type. Object-oriented programming (OOP) is a technique used to construct computer
programmes.

Key characteristic of OOP:


✓ Inheritance – Ability to create one object from another.
✓ Garbage Collection – automatically deleting things from memory that are no longer
needed by the program.
✓ Encapsulation - having the ability to conceal information and instructions inside of
an object.
✓ Polymorphism – The design of new classes is based on a single class.
✓ Message Passing – It is the way objects communicate with each other.
Event-driven Programming
"Event-driven programming" is a programming paradigm that based the program's control
flow on the happening of events. For example, an alert from the operating system or another
programme, or a keystroke or mouse click from the user.

Key Features of Event-Driven Programming:


✓ Event handlers – The actual computer code modules that run when a specific
trigger has happened are called event handlers.
✓ Event loops – The event loops keep testing the user interface to see if anything 
has happened.
✓ Trigger functions – These are combined with the object's name to decide which
event handler should be executed.
✓ GUI design (Forms and Controls) – used most frequently for GUIs where many
types of events are created.

THANUSHA SIVAYOGARAJA 29
These programming paradigms have many relationships. Such as:
✓ Although there isn't a clear hierarchical relationship between these three groupings,
they are all essentially nested within one another.
✓ Most paradigms are built on an event-driven and object-oriented base.
✓ Numerous languages make it easier to programme in one or more paradigms.
✓ The fact that so many paradigms are centred around the current issue helps users solve
problems faster.

Small snippets of code as example for the above three programming


paradigms

Small snippets of code for procedural programming paradigm

#start
#to find the average of 3 numbers
#requsting user to insert the three numbers to input
x = int (input ("Enter the first number: "))
y = int (input Enter the second number: "))
z = int (input ("Enter the third number: "))
#adding the three numbers
sum = x + y + z
#finding the average of the three numbers
avg = sum / 3
#displaying the numbers
print ("first number: ", + x)
print ("second number: ", + y)
print ("third number: ", + z)
#display the sum
print("sum of three numbers = ", + sum)
#display the average

THANUSHA SIVAYOGARAJA 30
Print ("Average = ", + avg)

Small snippets of code for object-oriented programming paradigm

Small snippets of
code for object-
oriented
programming
paradigm

THANUSHA SIVAYOGARAJA 31
Small snippets of code for Event driven programming paradigm

Analyzing with a critical eye the code examples provided for object-
oriented programming

As you can see from the code, I made an instance called "average Numbers" in order to
obtain the average of three numbers. In this instance, I've written some code to get the
average by dividing the total of the three numbers by three. After that, the user inputs data
into Main, which runs the scripts.

are requested for three elements. The instance 'average Numbers' is then called with the
three inputs to find the average. Using object-oriented programming, we may construct
objects like the one above and call them as required, eliminating the need to write the same
code over.

Analyzing the code examples provided as an example of event-driven


programming

As was previously said, a programme runs in response to an event from the user, such a
mouse click. I've given an example of a code that, depending on whether the user inputs the
correct username and password to log in, shows the words "Welcome!" and "Invalid

THANUSHA SIVAYOGARAJA 32
username or password". Before selecting "Login," the user must type their username and
password using their mouse and keyboard.

Activity 3

3.1. Pseudocode for Salary

BEGIN
Iput baseSalary, componentPercentage, taxPercentage
Calculate the salary component amount based on the given base salary and percentage
SET componentAmount = baseSalary * (componentPercentage
100 Calculate the taxable salary by adding the base salary and the salary component
SET taxableSalary = baseSalary + componentAmount
Calculate the tax amount based on the taxable salary and tax percentage
SET taxAmount = taxableSalary * (taxPercentage / 100)
Calculate the net salary by subtracting the tax amount from the taxable salary
SET netSalary = taxableSalary – taxAmount
Round the salary amounts to two decimal places
SET componentAmount = ROUND(componentAmount, 2)
SET taxableSalary = ROUND(taxableSalary, 2)
SET taxAmount = ROUND(taxAmount, 2)
SET netSalary = ROUND (netSalary, 2)
OUTPUT the calculated salary components
OUTPUT "Base Salary: ", baseSalary
OUTPUT "Taxable Salary: ", taxableSalary
OUTPUT "Tax Amount: ", taxAmount
OUTPUT "Net Salary: ", netSalary
END

Employee Salary Pseudocode

BEGIN
Input the employee name to search for
Input employeeName
SEARCH the employee salary database for the specified name
FOR EACH employee IN salaryDatabase
IF
employee.name EQUALS employeeName
THANUSHA SIVAYOGARAJA 33
OUTPUT the employee's salary components if found
OUTPUT "Employee: ", employee.name
OUTPUT "Base Salary: ", employee.baseSalary
OUTPUT "Salary Component: ", employee.componentAmount
OUTPUT "Taxable Salary: ", employee.taxableSalary
OUTPUT "Tax Amount: ", employee.taxAmount
OUTPUT "Net Salary: ", employee.netSalary
EXIT the loop once the employee is found
BREAK
ENDIF
END FOR
OUTPUT an error message if the employee is not found
IF employee NOT FOUND
OUTPUT "Error: Employee not found in database"
ENDIF
END

Salary Class
Declare private instance variables
PRIVATE baseSalary
PRIVATE componentPercentage
PRIVATE taxPercentage
PRIVATE componentAmount
PRIVATE taxableSalary
PRIVATE taxAmount
PRIVATE netSalary

CONSTRUCTOR
CONSTRUCTOR (baseSalary, componentPercentage, taxPercentage)
This.baseSalary = baseSalary
This.componentPercentage = componentPercentage
This.taxPercentage = taxPercentage
Calculate the salary components
This.componentAmount = baseSalary * (componentPercentage / 100)
This.taxableSalary = baseSalary + componentAmount
This.taxAmount = taxableSalary * (taxPercentage / 100)
This.netSalary = taxableSalary - taxAmount

THANUSHA SIVAYOGARAJA 34
END
CONSTRUCTOR

Public Net Salary


PUBLIC GET_NET_SALARY ()
RETURN netSalary
END GET_NET_SALARY

Public Base Salary


PUBLIC GET_BASE_SALARY ()
RETURN baseSalary
END GET_BASE_SALARY

Public Salary Component


PUBLIC GET_COMPONENT_AMOUNT ()
RETURN componentAmount
END GET_COMPONENT_AMOUNT
Public Taxable Salary
PUBLIC GET_TAXABLE_SALARY ()
RETURN taxableSalary
END GET_TAXABLE_SALARY

Public Tax Amount


PUBLIC GET_TAX_AMOUNT ()
RETURN taxAmount
END GET_TAX_AMOUNT
END CLASS

THANUSHA SIVAYOGARAJA 35
GUI for Above Salary Component

Calculate Employee Salary and Search Employee Salary.

Monthly Employee Salary

THANUSHA SIVAYOGARAJA 36
Primary Key ID Int
Name Varchar (50)
Address Varchar (50)
D. O. B DateTime
Gender Varchar (50) 3.2 Design the Database Structure
Telephone Int for Payroll System
Monthly Varchar (50)
Allowance Float
Overtime Float
Leaves Float
Primary Key ID Int

Salary Table Setting Table


Foreign Key ID Int
Value Float
Foreign Key ID Int
Emp_ID Int
NO_Pay Varchar (50)
Base_Pay Varchar (50)
Gross_Pay Varchar (50)
Date DateTime

THANUSHA SIVAYOGARAJA 37
3.3. IDE features and evaluate how its help for application developer.

Several functionalities are available for building software using an application known as an
Integrated Development Environment (IDE). Its goal is to facilitate the rapid and simple
creation, testing, and implementation of software applications. With the support of IDEs,
developers may produce higher-quality code and boost production.

How IDE features help application developer


➢ Debugging - an essential phase in the software development process. Developers
may walk through code execution, evaluate variables, and set breakpoints thanks to
the debugging features offered by IDEs. As a result, engineers can identify issues
more rapidly and easily.
➢ Deployment - IDEs provide tools for publishing software on a variety of platforms,
such as desktop, web, and mobile. The deployment procedure is made simpler by
this feature, which spares developers' time and effort.
➢ Code Editing - enumerate the steps involved in publishing software for desktop,
online, and mobile platforms. By streamlining the deployment process, this feature
helps developers save time and effort.
➢ Testing- Explain the process of releasing software for many platforms, including
desktop, web, and mobile. This feature saves developers time and effort by
simplifying the deployment process.
➢ Version Control Integration - The version control systems SVN, Git, and
Mercurial are natively supported by the majority of IDEs. Developers can manage
their code more effectively when they collaborate.

THANUSHA SIVAYOGARAJA 38
Activity 4

4.1. Design and Build GUI for Gryffindor Pay Roll System.

Login Page

THANUSHA SIVAYOGARAJA 39
Main Menu

THANUSHA SIVAYOGARAJA 40
Employee Menu

THANUSHA SIVAYOGARAJA 41
THANUSHA SIVAYOGARAJA 42
Register Employee

THANUSHA SIVAYOGARAJA 43
Update Employee

THANUSHA SIVAYOGARAJA 44
Delete Employee

THANUSHA SIVAYOGARAJA 45
Salary Menu

THANUSHA SIVAYOGARAJA 46
Employee month Salary

THANUSHA SIVAYOGARAJA 47
THANUSHA SIVAYOGARAJA 48
Salary Report Per Month

THANUSHA SIVAYOGARAJA 49
THANUSHA SIVAYOGARAJA 50
Salary Setting

THANUSHA SIVAYOGARAJA 51
THANUSHA SIVAYOGARAJA 52
THANUSHA SIVAYOGARAJA 53
THANUSHA SIVAYOGARAJA 54
4.2. Debugging Process and Debugging Facilities in IDE

Software debugging entails locating and resolving problems. It is an essential component of


software development since even tiny mistakes may have a big impact on consumers.
Developers have access to a multitude of debugging tools at their disposal. Debugging is
sped up with the usage of IDEs.

Debugging Facilities in IDE


• Create Breakpoints: You may include breakpoints into the code to halt the
programme at particular locations after the problem has been located. You may then
see the code and data structures that are at the breakpoint.
• Evaluate Expressions: Expressions that use string, arithmetic, and logic
operations can all be evaluated to find out the status of the programme.
• Recreate the issue: The first step in debugging is to replicate the problem. You
must understand the issue and replicate it on your machine in order to achieve this.
• Follow the Code’s step: You may verify the program's current state and variable
values by iterating over the code line by line or instruction by instruction.

THANUSHA SIVAYOGARAJA 55
4.3. Explain Coding standards for Payroll System.

When developing a payroll system, it is imperative to follow industry-specific coding


standards. Payroll systems often deal with sensitive and private data, therefore security,
accuracy, and adherence to legal and regulatory standards need to be given first priority.
When developing a payroll system, programmers should consider the following best
practises for coding.
1. Compliance - Payroll systems have to go by a number of legal and regulatory
obligations, including as tax regulations, employment legislation, and data protection
laws. The General Data Protection Regulation (GDPR) and the Payment Card
Industry Data Security Standard (PCI DSS) must be complied with by the system,
according to developers.
2. Security - Prioritizing security is crucial while creating a payroll system. To
safeguard sensitive data, such as employee personal information, pay information,
and tax information, developers should abide by secure coding best practises. To do
this, it is necessary to apply sufficient encryption, suitable access controls, and
secure programming approaches.
3. Naming Conventions - Programmers should follow trustworthy and
understandable naming guidelines while developing a payroll system. This means
naming variables, functions, and other code elements in a way that makes sense and
is easy to comprehend.
4. Accuracy - For employee salaries, taxes, and other deductions to be processed and
computed accurately, payroll systems are required. To ensure correctness,
developers should use the proper data validation techniques, such as input
sanitization, data type checking, and range checking. Developers also need to make
sure that computations follow the right rounding rules and comply with legal and
regulatory constraints.

4.4. Coding standards roles and purposes and how it helps to


team and individuals

• Coding standards help to ensure uniformity across the codebase by defining


guidelines for naming conventions, formatting, documentation, error handling, and
other aspects of the code. When the code is readable and consistent, maintenance and
debugging need less time and effort.
• Coding standards provide guidelines for the format, style, and other readability-
improving elements of the code. Readable code is easier to understand and maintain,
which reduces the likelihood of errors and boosts overall productivity.
• Coding standards are guidelines and conventions that developers follow while writing
code. These recommendations help to guarantee that code is trustworthy,
understandable, legible, and maintainable. Coding standards provide several vital
functions that are required for the development of software. In my response, I'll go

THANUSHA SIVAYOGARAJA 56
over a few of the objectives and uses of coding standards and explain how they help
both individuals and teams.
• Coding standards provide guidelines for the format, style, and other readability-
improving elements of the code. Code that is easy to read and understand reduces the
likelihood of errors and overall output.

REFERENCES

Google.com. (2022). Redirect Notice. [online] Available at:


https://www.google.com/url?sa=i&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fwww.geeksforgeeks.org%2Fintro
duction-to-
algorithms%2F&psig=AOvVaw2S1f51mzSAXdqYDRE19Qk8&ust=1671260101212000&sou
rce=images&cd=vfe&ved=0CBAQjRxqFwoTCMjB5pjH_fsCFQAAAAAdAAAAABAE

Google.com. (2022). Redirect Notice. [online] Available at:


https://www.google.com/url?sa=i&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fwww.geeksforgeeks.org%2Fwhat
-is-logarithmic-time-complexity%2F&psig=AOvVaw1oeybuVEwSB-
IXhkPBU1_W&ust=1670906832937000&source=images&cd=vfe&ved=0CBAQjRxqFwoTC
Pjk96al8_sCFQAAAAAdAAAAABAD [

SearchSoftwareQuality. (n.d.). What is debugging? [online] Available at:


https://www.techtarget.com/searchsoftwarequality/definition/debugging.
.

THANUSHA SIVAYOGARAJA 57
MindStick (n.d.). What are the advantages of Visual Studio IDE? [online]
www.mindstick.com. Available at: https://www.mindstick.com/forum/156477/what-are-the-
advantages-of-visual-studio-ide.

MindStick (n.d.). What are the advantages of Visual Studio IDE? [online]
www.mindstick.com. Available at: https://www.mindstick.com/forum/156477/what-are-the-
advantages-of-visual-studio-ide.

Mikejo5000 (n.d.). Tips and tricks in the debugger - Visual Studio (Windows). [online]
learn.microsoft.com. Available at: https://learn.microsoft.com/en-
us/visualstudio/debugger/debugger-tips-and-tricks?view=vs-2022

EDUCBA. (2019). What is Debugging? | Different Process, Tools and Strategies of


Debugging. [online] Available at: https://www.educba.com/what-is-debugging/.

BrowserStack. (n.d.). Coding Standards and Best Practices To Follow. [online] Available at:
HTTPS://WWW.BROWSERSTACK.COM/GUIDE/CODING-STANDARDS-BEST-
PRACTICES#:~:TEXT=PRACTICES%20TO%20FOLLOW-
,WHAT%20ARE%20CODING%20STANDARDS%3F,SOPHISTICATED%20AND%20HIGH
LY%20FUNCTIONAL%20CODE.

Mikejo5000 (n.d.). First look at the debugger - Visual Studio (Windows). [online]
learn.microsoft.com. Available at: https://learn.microsoft.com/en-
us/visualstudio/debugger/debugger-feature-tour?view=vs-2022.

THANUSHA SIVAYOGARAJA 58

You might also like