Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Class GetPlanFactory { / / use getPlan method to get object og tupe plan public Plan getPlan ( string planType ) { if ( planType
Class GetPlanFactory
use getPlan method to get object og tupe plan
public Plan getPlanstring planType
if planType null
return null;
ifplanTypeequalsIgnoreCaseDOMESTICPLANT
return new DomesticPlan;
else ifplanTypeequalsIgnoreCaseCOMMERCIALPLANT
return new CommercialPlan;
else ifplanTypeequalsIgnoreCaseINSTITUTIONALPLAN
return new InstitutionalPlan;
retum null;
Create the following three Concrete classes that extends Plan abstract class.
a DomesticPlan, InstitutionalPlan, CommercialPlan
b Each plan returns the rate at which electricity bill can be paid. Such as for domestioplas is for InstitutionalPlan is and CommercialPlan is
Answer:
class DomesticPlan
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started