C# Payroll System: Implementing OOP Principles and Design Patterns
VerifiedAdded on 2025/05/01
|18
|2558
|427
AI Summary
Desklib provides past papers and solved assignments for students. This project explores OOP and design patterns in C#.

Table of Contents
Introduction....................................................................................................................................2
LO1..................................................................................................................................................3
P1.................................................................................................................................................3
M1................................................................................................................................................5
LO2..................................................................................................................................................6
P2.................................................................................................................................................6
M2................................................................................................................................................7
LO3..................................................................................................................................................8
P3.................................................................................................................................................8
M3..............................................................................................................................................13
LO4................................................................................................................................................15
P4...............................................................................................................................................15
M4..............................................................................................................................................16
Conclusion....................................................................................................................................17
References.....................................................................................................................................18
List of Figures
Figure 1: Class Diagram..................................................................................................................6
Figure 2: Screenshot 1.....................................................................................................................8
Figure 3: Screenshot 2.....................................................................................................................8
Figure 4: Screenshot 3.....................................................................................................................9
Figure 5: Screenshot 4.....................................................................................................................9
Figure 6: Screenshot 5...................................................................................................................10
Figure 7: Screenshot 6...................................................................................................................10
Figure 8: Screenshot 7...................................................................................................................11
Figure 9: Screenshot 8...................................................................................................................11
Figure 10: Screenshot 9.................................................................................................................12
Figure 11: Program for Payslip 1...................................................................................................13
Figure 12: Program for Payslip 2...................................................................................................14
Introduction....................................................................................................................................2
LO1..................................................................................................................................................3
P1.................................................................................................................................................3
M1................................................................................................................................................5
LO2..................................................................................................................................................6
P2.................................................................................................................................................6
M2................................................................................................................................................7
LO3..................................................................................................................................................8
P3.................................................................................................................................................8
M3..............................................................................................................................................13
LO4................................................................................................................................................15
P4...............................................................................................................................................15
M4..............................................................................................................................................16
Conclusion....................................................................................................................................17
References.....................................................................................................................................18
List of Figures
Figure 1: Class Diagram..................................................................................................................6
Figure 2: Screenshot 1.....................................................................................................................8
Figure 3: Screenshot 2.....................................................................................................................8
Figure 4: Screenshot 3.....................................................................................................................9
Figure 5: Screenshot 4.....................................................................................................................9
Figure 6: Screenshot 5...................................................................................................................10
Figure 7: Screenshot 6...................................................................................................................10
Figure 8: Screenshot 7...................................................................................................................11
Figure 9: Screenshot 8...................................................................................................................11
Figure 10: Screenshot 9.................................................................................................................12
Figure 11: Program for Payslip 1...................................................................................................13
Figure 12: Program for Payslip 2...................................................................................................14
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Introduction
The assessment is based on the OOP and the given assessment is subcategorized into different
parts. In the first part of the assessment, it requires discussing the characteristics of the OOP and
its definition as well with respect to the C#. A program is needed to perform in part 3 of the
assessment which is based on the payroll system. A series of the UML diagrams are also needed
in this assessment which will be covered in part 2 of the assessment. And in the last part, there
are scenarios that are given on which various design patterns need to create. The overall
assessment will help in understanding the concept of the given scenario.
The assessment is based on the OOP and the given assessment is subcategorized into different
parts. In the first part of the assessment, it requires discussing the characteristics of the OOP and
its definition as well with respect to the C#. A program is needed to perform in part 3 of the
assessment which is based on the payroll system. A series of the UML diagrams are also needed
in this assessment which will be covered in part 2 of the assessment. And in the last part, there
are scenarios that are given on which various design patterns need to create. The overall
assessment will help in understanding the concept of the given scenario.

LO1
P1
Object-oriented programming is a type of programming paradigm which is totally dependent on
the objects that include data and the methods which target for the incorporation the advantage of
the modularity and the reusability (Derezińska, A. and Byczkowski, M., 2018). The instance of
the class which is referred to as an Object is used in order to make the interaction with each other
so as to design the applications and various programs for the computer. There is a various
example of the object-oriented programming language which includes C++, Delphi, C #, Python,
Ruby, Java, and many others.
According to the Grady Booch a definition of the object-oriented programming is that “ a
method for the implementation where the program is organized as the collection of the objects,
each of which is represented as an instance of the class and whose class are the member of
hierarchy class which is united through the inheritance relationships.” A small discussion on the
topic which is related to the relationships will also include meanwhile there are various
characteristics of the OOP which need to be discussed and provided in the coming paragraphs.
There are various features of the object-oriented programming that include:
The programs in OOP are properly organized around the objects and are grouped in the
classes.
The approach which is used designing of the program is the Bottom-up approach.
The objects present in the programs interact with the help of functions.
It mainly focuses on data which is along with the methods to operate upon the data
object.
The design can be reused by creating different new classes and by the addition of features
into the existing classes of the program.
Their advantage of this language is to reuse the code and this is possible just because of the
relationships that are present in the classes and these relationships are inheritance, composition,
association as well as aggregation. These relationships are dependent on the “is a”, “has a” and
“part of” relationship (Henseler, J., 2017). They are discussed in detail below:
First is inheritance which is the type of “is a” relationship that is dependent on the inheritance
that can be categorized in the class inheritance or interface inheritance. Inheritance is the
relationship which is based on parent-child in which a new class is created with the help of the
class which already exists. For better understanding, it can be said that “Dog is an animal” or
“Mango is a fruit”.
P1
Object-oriented programming is a type of programming paradigm which is totally dependent on
the objects that include data and the methods which target for the incorporation the advantage of
the modularity and the reusability (Derezińska, A. and Byczkowski, M., 2018). The instance of
the class which is referred to as an Object is used in order to make the interaction with each other
so as to design the applications and various programs for the computer. There is a various
example of the object-oriented programming language which includes C++, Delphi, C #, Python,
Ruby, Java, and many others.
According to the Grady Booch a definition of the object-oriented programming is that “ a
method for the implementation where the program is organized as the collection of the objects,
each of which is represented as an instance of the class and whose class are the member of
hierarchy class which is united through the inheritance relationships.” A small discussion on the
topic which is related to the relationships will also include meanwhile there are various
characteristics of the OOP which need to be discussed and provided in the coming paragraphs.
There are various features of the object-oriented programming that include:
The programs in OOP are properly organized around the objects and are grouped in the
classes.
The approach which is used designing of the program is the Bottom-up approach.
The objects present in the programs interact with the help of functions.
It mainly focuses on data which is along with the methods to operate upon the data
object.
The design can be reused by creating different new classes and by the addition of features
into the existing classes of the program.
Their advantage of this language is to reuse the code and this is possible just because of the
relationships that are present in the classes and these relationships are inheritance, composition,
association as well as aggregation. These relationships are dependent on the “is a”, “has a” and
“part of” relationship (Henseler, J., 2017). They are discussed in detail below:
First is inheritance which is the type of “is a” relationship that is dependent on the inheritance
that can be categorized in the class inheritance or interface inheritance. Inheritance is the
relationship which is based on parent-child in which a new class is created with the help of the
class which already exists. For better understanding, it can be said that “Dog is an animal” or
“Mango is a fruit”.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Another is Composition which is a type of “part-of” relationship that means the mean use of the
instances which references to the other objects. In this relationship, the entities are dependent on
each other for an example “stems are the part of a plant”.
Next is Association, which posses the “has-a” relationship and is created between the classes by
the use of their objects. This relationship can be either one-to-one or one-to-many or many-to-
many. It is said that two classes can posses have a relationship if they share the object of each
other for the same work as well as on the same time but they should exist without getting
dependent on each other and should have their own time of the lives.
Next is aggregation, which has the relationship of “has a” and it is a type of special form of the
association. In the association, there is no need to work on the class as the owner but in the case
of aggregation, the owner will act as an entity. In this relationship both the entities get to meet in
order to perform some work and after that they get separates. This relationship is a way of
association.
instances which references to the other objects. In this relationship, the entities are dependent on
each other for an example “stems are the part of a plant”.
Next is Association, which posses the “has-a” relationship and is created between the classes by
the use of their objects. This relationship can be either one-to-one or one-to-many or many-to-
many. It is said that two classes can posses have a relationship if they share the object of each
other for the same work as well as on the same time but they should exist without getting
dependent on each other and should have their own time of the lives.
Next is aggregation, which has the relationship of “has a” and it is a type of special form of the
association. In the association, there is no need to work on the class as the owner but in the case
of aggregation, the owner will act as an entity. In this relationship both the entities get to meet in
order to perform some work and after that they get separates. This relationship is a way of
association.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

M1
Design patterns are the solution of generally reusing the template to commonly occurring
problems in the software designs and this pattern show the relationship and interaction which
occur between the classes as well as the object. This is used in order to enhance the speed of the
process of development by providing the tested as well as the proved and verified paradigm of
the development.
The main goal is to understand the issue as the matching some pattern and another goal is to
reuse the old interface and making the current design reusable so that it can be used in the future
as well. For making understanding better an example is discussed regarding the real world
situation in which one instance of the class is created. As an example for a country, only one
president is possible and this is known as singleton pattern. More examples regarding the
software can be taken as DB connection which is shared by more than one object as by creating
the separate connection of DB for every single object might be expensive. Similarly, there is a
possibility of the single configuration manager or the error manager that can handle the problem
and avoid creating more managers.
There are various types of design patterns that include creational, structural and behavioral. All
these are discussed here in detail:
First is a Creational design pattern which is related to the class instantiation or the creation of
the objects. This particular can be more divided into the class creational pattern and the object
creational pattern. While the creation of the class patterns uses the inheritance in an effective
way of the instantiation process and the creation of the object pattern uses the delegation in order
to get the job done effectively. The design patterns for the creational design are the Factory
method, Builder, Object Pool, prototype as well as a singleton.
Another comes the Structural design pattern that is related to the organizing of the different
classes as well as the objects in order to form and create large structures so as to provide the new
functions. The patterns that include in the Structural design pattern are the Composite, Decorator,
Façade, Flyweight, Proxy and private data class as well as bridge also.
Moving on to the third design pattern which is the Behavioral design pattern which is related to
identify the common communication patterns which are between the objects as well as to realize
the patterns that are developed. These patterns are the chain of the responsibility, the interpreter,
command, iterator, mediator, null object, the observer, state, template, strategy, template method,
and visitor.
Design patterns are the solution of generally reusing the template to commonly occurring
problems in the software designs and this pattern show the relationship and interaction which
occur between the classes as well as the object. This is used in order to enhance the speed of the
process of development by providing the tested as well as the proved and verified paradigm of
the development.
The main goal is to understand the issue as the matching some pattern and another goal is to
reuse the old interface and making the current design reusable so that it can be used in the future
as well. For making understanding better an example is discussed regarding the real world
situation in which one instance of the class is created. As an example for a country, only one
president is possible and this is known as singleton pattern. More examples regarding the
software can be taken as DB connection which is shared by more than one object as by creating
the separate connection of DB for every single object might be expensive. Similarly, there is a
possibility of the single configuration manager or the error manager that can handle the problem
and avoid creating more managers.
There are various types of design patterns that include creational, structural and behavioral. All
these are discussed here in detail:
First is a Creational design pattern which is related to the class instantiation or the creation of
the objects. This particular can be more divided into the class creational pattern and the object
creational pattern. While the creation of the class patterns uses the inheritance in an effective
way of the instantiation process and the creation of the object pattern uses the delegation in order
to get the job done effectively. The design patterns for the creational design are the Factory
method, Builder, Object Pool, prototype as well as a singleton.
Another comes the Structural design pattern that is related to the organizing of the different
classes as well as the objects in order to form and create large structures so as to provide the new
functions. The patterns that include in the Structural design pattern are the Composite, Decorator,
Façade, Flyweight, Proxy and private data class as well as bridge also.
Moving on to the third design pattern which is the Behavioral design pattern which is related to
identify the common communication patterns which are between the objects as well as to realize
the patterns that are developed. These patterns are the chain of the responsibility, the interpreter,
command, iterator, mediator, null object, the observer, state, template, strategy, template method,
and visitor.

LO2
P2
Figure 1: Class Diagram
P2
Figure 1: Class Diagram
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

M2
The above-mentioned class diagram is based on the code made to implement the Payroll System
(Hussain et al., 2016). The diagram is developed using the UML tools and is drawn on draw.io.
The diagram consists of three classes named as-
Form 1- The first class defined in above-made diagram is the Form1 where methods such as
Form1_Load, comboEmptype_Dropdown, label4_click and btnCalPay_Click are defined.
Payroll- The next class being defined is the Payroll. It contains a single method named as
Payroll_Load.
CalculatePaySlip- The last class that is shown in the Class diagram is the also contains some of
the methods named as CalculateSalariedEmployee, CalculateHourlyEmployee, and
CalculateCommissionEmployee.
The above-mentioned class diagram is based on the code made to implement the Payroll System
(Hussain et al., 2016). The diagram is developed using the UML tools and is drawn on draw.io.
The diagram consists of three classes named as-
Form 1- The first class defined in above-made diagram is the Form1 where methods such as
Form1_Load, comboEmptype_Dropdown, label4_click and btnCalPay_Click are defined.
Payroll- The next class being defined is the Payroll. It contains a single method named as
Payroll_Load.
CalculatePaySlip- The last class that is shown in the Class diagram is the also contains some of
the methods named as CalculateSalariedEmployee, CalculateHourlyEmployee, and
CalculateCommissionEmployee.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

LO3
P3
The Program for the given is explained in this part-
Screenshots of the Implementation
Figure 2: Screenshot 1
Figure 3: Screenshot 2
P3
The Program for the given is explained in this part-
Screenshots of the Implementation
Figure 2: Screenshot 1
Figure 3: Screenshot 2

Figure 4: Screenshot 3
Figure 5: Screenshot 4
Figure 5: Screenshot 4
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Figure 6: Screenshot 5
Figure 7: Screenshot 6
Figure 7: Screenshot 6
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Figure 8: Screenshot 7
Figure 9: Screenshot 8
Figure 9: Screenshot 8

Figure 10: Screenshot 9
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 18
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.