Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
