HEllo everyone so I am using a base class and other sub classes. My problem is that I don't know how to call a function from a base class so that I can use it for another class.
Here is a part of my base class implementation file. I want to reuse the function: getInsuranceFee();
This is the instructions:
The base class Package’s calculateCost function should determine the cost by multiplying the weight by the costPerOunce and adding the insurance fee if applicable. Insurance fees are based on the item’s declared value or insuranceType as shown in the table below:
Insurance Type Insurance Fee ($)
Upto100 5
Upto1000 15
Upto5000 40
PriorityPackage should redefine calculateCost function so it calculates the shipping cost based on the package type and dimensions and independent of its weight. A PriorityPackage’s cost is a flat fee that depends on the package type and dimensions as summarized below: