SlideShare a Scribd company logo
1 of 1
Download to read offline
1 of 1
An Exercise for Factory Method Design Pattern in C#
Author: Kasun Ranga Wijeweera
Email: krw19870829@gmail.com
Date: 20200403
1) Design a system to handle the shapes: circles, ellipses, rectangles and squares. Use the
Factory Method design pattern according to the instructions given below. Read all the steps
carefully before you begin answering the questions.
a) The interface should have two method prototypes for computing the area and
perimeter of the shapes.
b) Create classes for each of the shapes. You should use inheritance appropriately.
c) The object should be created based on the user inputs as shown in table below.
User input Object type
c Circle object
r Rectangle object
s Square object
e Ellipse object
d) Create a circle object with the radius = 7.
e) Compute the area and perimeter of the circle object created in (1) (d) above.
Note:
1. Circle of radius = r.
a. Area = πr2
b. Perimeter = 2πr
2. Ellipse of radii a and b.
a. Area = πab
b. Perimeter = 2π√{(a2
+b2
)/2}

More Related Content

What's hot

Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version ControlSourabh Sahu
 
Stl Containers
Stl ContainersStl Containers
Stl Containersppd1961
 
NUMERICAL METHODS
NUMERICAL   METHODSNUMERICAL   METHODS
NUMERICAL METHODSAMOGHA A K
 
Interpolation with Finite differences
Interpolation with Finite differencesInterpolation with Finite differences
Interpolation with Finite differencesDr. Nirav Vyas
 
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...Edureka!
 
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기Chris Ohk
 
C++20 Key Features Summary
C++20 Key Features SummaryC++20 Key Features Summary
C++20 Key Features SummaryChris Ohk
 
The False-Position Method
The False-Position MethodThe False-Position Method
The False-Position MethodTayyaba Abbas
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Simplilearn
 
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective GitChanwoong Kim
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial IJim Yeh
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 
Administration des base de donnees sous oracle 10g
Administration des base de donnees sous oracle 10g Administration des base de donnees sous oracle 10g
Administration des base de donnees sous oracle 10g noble Bajoli
 

What's hot (20)

Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version Control
 
Stl Containers
Stl ContainersStl Containers
Stl Containers
 
NUMERICAL METHODS
NUMERICAL   METHODSNUMERICAL   METHODS
NUMERICAL METHODS
 
Python Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math modulePython Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math module
 
Interpolation with Finite differences
Interpolation with Finite differencesInterpolation with Finite differences
Interpolation with Finite differences
 
Présentation Docker
Présentation DockerPrésentation Docker
Présentation Docker
 
Tp4 - PHP
Tp4 - PHPTp4 - PHP
Tp4 - PHP
 
Error_Analysis.pdf
Error_Analysis.pdfError_Analysis.pdf
Error_Analysis.pdf
 
Es272 ch2
Es272 ch2Es272 ch2
Es272 ch2
 
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
 
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
 
C++20 Key Features Summary
C++20 Key Features SummaryC++20 Key Features Summary
C++20 Key Features Summary
 
Ch1
Ch1Ch1
Ch1
 
The False-Position Method
The False-Position MethodThe False-Position Method
The False-Position Method
 
Secant method
Secant methodSecant method
Secant method
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective Git
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Administration des base de donnees sous oracle 10g
Administration des base de donnees sous oracle 10g Administration des base de donnees sous oracle 10g
Administration des base de donnees sous oracle 10g
 

Similar to An Exercise for Factory Method Design Pattern in C#

Assignment for Factory Method Design Pattern in C# [ANSWERS]
Assignment for Factory Method Design Pattern in C# [ANSWERS]Assignment for Factory Method Design Pattern in C# [ANSWERS]
Assignment for Factory Method Design Pattern in C# [ANSWERS]Kasun Ranga Wijeweera
 
Graphics Within Industry
Graphics Within IndustryGraphics Within Industry
Graphics Within Industrys2francetrip
 
Cad notes - ENGINEERING DRAWING - RGPV,BHOPAL
Cad notes - ENGINEERING DRAWING - RGPV,BHOPALCad notes - ENGINEERING DRAWING - RGPV,BHOPAL
Cad notes - ENGINEERING DRAWING - RGPV,BHOPALAbhishek Kandare
 
R05010303 C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...
R05010303  C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...R05010303  C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...
R05010303 C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...guestd436758
 
Mathematics Learning Module for Grade 8 K - 12 Curriculum
Mathematics Learning Module for Grade 8 K - 12 CurriculumMathematics Learning Module for Grade 8 K - 12 Curriculum
Mathematics Learning Module for Grade 8 K - 12 CurriculumJasrel Roby Peralta
 
K to 12 - Grade 8 Math Learner Module
K to 12 - Grade 8 Math Learner ModuleK to 12 - Grade 8 Math Learner Module
K to 12 - Grade 8 Math Learner ModuleNico Granada
 
192459112 math-learner-module-k-12-grade-8
192459112 math-learner-module-k-12-grade-8192459112 math-learner-module-k-12-grade-8
192459112 math-learner-module-k-12-grade-8Nerdy Gee
 
Math Learner Module K to 12 Grade 8
Math Learner Module K to 12 Grade 8Math Learner Module K to 12 Grade 8
Math Learner Module K to 12 Grade 8Albert Maniclang
 
Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061gurbaxrawat
 
0580_s12_qp_41
0580_s12_qp_410580_s12_qp_41
0580_s12_qp_41King Ali
 
Eng104 engineering drawing chp 0
Eng104   engineering drawing chp 0Eng104   engineering drawing chp 0
Eng104 engineering drawing chp 0Nur Aishah Azriy
 
1291 fa13 assign2_cube_drawings
1291 fa13 assign2_cube_drawings1291 fa13 assign2_cube_drawings
1291 fa13 assign2_cube_drawingsNYCCTfab
 
Draw 224 prelim exam
Draw 224 prelim examDraw 224 prelim exam
Draw 224 prelim examaltherdabon
 

Similar to An Exercise for Factory Method Design Pattern in C# (20)

Assignment for Factory Method Design Pattern in C# [ANSWERS]
Assignment for Factory Method Design Pattern in C# [ANSWERS]Assignment for Factory Method Design Pattern in C# [ANSWERS]
Assignment for Factory Method Design Pattern in C# [ANSWERS]
 
CAD
CADCAD
CAD
 
Cad notes
Cad notesCad notes
Cad notes
 
Graphics Within Industry
Graphics Within IndustryGraphics Within Industry
Graphics Within Industry
 
Cad notes - ENGINEERING DRAWING - RGPV,BHOPAL
Cad notes - ENGINEERING DRAWING - RGPV,BHOPALCad notes - ENGINEERING DRAWING - RGPV,BHOPAL
Cad notes - ENGINEERING DRAWING - RGPV,BHOPAL
 
R05010303 C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...
R05010303  C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...R05010303  C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...
R05010303 C O M P U T E R P R O G R A M M I N G A N D N U M E R I C A L M E ...
 
Cad notes
Cad notesCad notes
Cad notes
 
Cad cam cae
Cad cam caeCad cam cae
Cad cam cae
 
Mathlearnermodule
MathlearnermoduleMathlearnermodule
Mathlearnermodule
 
Mathematics Learning Module for Grade 8 K - 12 Curriculum
Mathematics Learning Module for Grade 8 K - 12 CurriculumMathematics Learning Module for Grade 8 K - 12 Curriculum
Mathematics Learning Module for Grade 8 K - 12 Curriculum
 
K to 12 - Grade 8 Math Learner Module
K to 12 - Grade 8 Math Learner ModuleK to 12 - Grade 8 Math Learner Module
K to 12 - Grade 8 Math Learner Module
 
192459112 math-learner-module-k-12-grade-8
192459112 math-learner-module-k-12-grade-8192459112 math-learner-module-k-12-grade-8
192459112 math-learner-module-k-12-grade-8
 
Math Learner Module K to 12 Grade 8
Math Learner Module K to 12 Grade 8Math Learner Module K to 12 Grade 8
Math Learner Module K to 12 Grade 8
 
Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061
 
0580_s12_qp_41
0580_s12_qp_410580_s12_qp_41
0580_s12_qp_41
 
Eng104 engineering drawing chp 0
Eng104   engineering drawing chp 0Eng104   engineering drawing chp 0
Eng104 engineering drawing chp 0
 
1291 fa13 assign2_cube_drawings
1291 fa13 assign2_cube_drawings1291 fa13 assign2_cube_drawings
1291 fa13 assign2_cube_drawings
 
Draw 224 prelim exam
Draw 224 prelim examDraw 224 prelim exam
Draw 224 prelim exam
 
Diagrams part 4
Diagrams part 4Diagrams part 4
Diagrams part 4
 
Math 116 pres. 5
Math 116 pres. 5Math 116 pres. 5
Math 116 pres. 5
 

More from Kasun Ranga Wijeweera

Algorithms for Convex Partitioning of a Polygon
Algorithms for Convex Partitioning of a PolygonAlgorithms for Convex Partitioning of a Polygon
Algorithms for Convex Partitioning of a PolygonKasun Ranga Wijeweera
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmKasun Ranga Wijeweera
 
Getting Started with Visual Basic Programming
Getting Started with Visual Basic ProgrammingGetting Started with Visual Basic Programming
Getting Started with Visual Basic ProgrammingKasun Ranga Wijeweera
 
Variables in Visual Basic Programming
Variables in Visual Basic ProgrammingVariables in Visual Basic Programming
Variables in Visual Basic ProgrammingKasun Ranga Wijeweera
 
Conditional Logic in Visual Basic Programming
Conditional Logic in Visual Basic ProgrammingConditional Logic in Visual Basic Programming
Conditional Logic in Visual Basic ProgrammingKasun Ranga Wijeweera
 

More from Kasun Ranga Wijeweera (20)

Decorator Design Pattern in C#
Decorator Design Pattern in C#Decorator Design Pattern in C#
Decorator Design Pattern in C#
 
Singleton Design Pattern in C#
Singleton Design Pattern in C#Singleton Design Pattern in C#
Singleton Design Pattern in C#
 
Introduction to Design Patterns
Introduction to Design PatternsIntroduction to Design Patterns
Introduction to Design Patterns
 
Algorithms for Convex Partitioning of a Polygon
Algorithms for Convex Partitioning of a PolygonAlgorithms for Convex Partitioning of a Polygon
Algorithms for Convex Partitioning of a Polygon
 
Geometric Transformations II
Geometric Transformations IIGeometric Transformations II
Geometric Transformations II
 
Geometric Transformations I
Geometric Transformations IGeometric Transformations I
Geometric Transformations I
 
Introduction to Polygons
Introduction to PolygonsIntroduction to Polygons
Introduction to Polygons
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing Algorithm
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing Algorithm
 
Loops in Visual Basic: Exercises
Loops in Visual Basic: ExercisesLoops in Visual Basic: Exercises
Loops in Visual Basic: Exercises
 
Conditional Logic: Exercises
Conditional Logic: ExercisesConditional Logic: Exercises
Conditional Logic: Exercises
 
Getting Started with Visual Basic Programming
Getting Started with Visual Basic ProgrammingGetting Started with Visual Basic Programming
Getting Started with Visual Basic Programming
 
CheckBoxes and RadioButtons
CheckBoxes and RadioButtonsCheckBoxes and RadioButtons
CheckBoxes and RadioButtons
 
Variables in Visual Basic Programming
Variables in Visual Basic ProgrammingVariables in Visual Basic Programming
Variables in Visual Basic Programming
 
Loops in Visual Basic Programming
Loops in Visual Basic ProgrammingLoops in Visual Basic Programming
Loops in Visual Basic Programming
 
Conditional Logic in Visual Basic Programming
Conditional Logic in Visual Basic ProgrammingConditional Logic in Visual Basic Programming
Conditional Logic in Visual Basic Programming
 
Assignment for Variables
Assignment for VariablesAssignment for Variables
Assignment for Variables
 
Assignment for Events
Assignment for EventsAssignment for Events
Assignment for Events
 
Mastering Arrays Assignment
Mastering Arrays AssignmentMastering Arrays Assignment
Mastering Arrays Assignment
 
Arrays in Visual Basic Programming
Arrays in Visual Basic ProgrammingArrays in Visual Basic Programming
Arrays in Visual Basic Programming
 

Recently uploaded

KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 

Recently uploaded (20)

KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 

An Exercise for Factory Method Design Pattern in C#

  • 1. 1 of 1 An Exercise for Factory Method Design Pattern in C# Author: Kasun Ranga Wijeweera Email: krw19870829@gmail.com Date: 20200403 1) Design a system to handle the shapes: circles, ellipses, rectangles and squares. Use the Factory Method design pattern according to the instructions given below. Read all the steps carefully before you begin answering the questions. a) The interface should have two method prototypes for computing the area and perimeter of the shapes. b) Create classes for each of the shapes. You should use inheritance appropriately. c) The object should be created based on the user inputs as shown in table below. User input Object type c Circle object r Rectangle object s Square object e Ellipse object d) Create a circle object with the radius = 7. e) Compute the area and perimeter of the circle object created in (1) (d) above. Note: 1. Circle of radius = r. a. Area = πr2 b. Perimeter = 2πr 2. Ellipse of radii a and b. a. Area = πab b. Perimeter = 2π√{(a2 +b2 )/2}