Monday, August 22, 2011

ICT 203 - Q1d (Foundations in Modern System Design)

Three classes should be coded, each with its instance variables (if applicable), constructor, and accessor methods. The question also guides that each subclass should have a computeFee() method, as coded below: Question

For OrdinaryMember class:

public double computeFee() {

double payment = 0;

if (getIsOverseas())

payment = getMembershipFee() * 0.5;

else

payment = getMembershipFee();

return payment;

}


For AssociateMember class:

public double computeFee() {

double payment = 0;

if (getIsOverseas())

payment = getMembershipFee() * 0.5;

else

payment = getMembershipFee();

payment = payment + magazineCharge;

return payment;

}

No comments:

Post a Comment