A
Anonymous
Guest
The idea of inheritance would mean that the base class 'bank' should have a method showFee(). This means that each type of bank can have the showFee method called and show the fees applicable to them. If a bank doesn't have any specific fees, then the method in the base class would be called. This is the same as most of the methods you've defined in bank and bankAmerica, where most get passed through to the base class. (Documentation at http://php.net/manual/en/language.oop5.inheritance.php)
The main thing you aren't doing is creating an instance of the bankAmerica class. So the line should be...
One other things which is worth trying to get used to now is the consistency and format of class and method names. Class names usually start with an upper case letter (so Bank and BankAmerica). Method names should be at least consistent - so checkBalance probably would be check_Balance (in your case), and set_Balance and set_withdraw use different capitalisation. Being consistent helps others use your code easier and also you can usually read it better as it reads the same as code you may find in libraries.
The main thing you aren't doing is creating an instance of the bankAmerica class. So the line should be...
Code:
$bankAmerica = new bankAmerica ($var);
One other things which is worth trying to get used to now is the consistency and format of class and method names. Class names usually start with an upper case letter (so Bank and BankAmerica). Method names should be at least consistent - so checkBalance probably would be check_Balance (in your case), and set_Balance and set_withdraw use different capitalisation. Being consistent helps others use your code easier and also you can usually read it better as it reads the same as code you may find in libraries.