This is the question at hand, and I have no idea where to start.
Purpose: This is an exercice to test your basic knowledge of interface and class in PHP oriented object.
Instruction:
- Create an interface class called Car. It should contain only a single method, finalCost();
- Create another class, Chevy, that implements Car. It should have a protected variable called cost. It should have a constructor which takes the cost in argument and sets it. It should have the method finalCost() which takes in argument a tax percentage and returns the final cost of the car in $ using the cost set when the object is initialized.
- Use the Chevy class to get the cost of a Chevy with a tax of 12% and the initial cost of 20000. Echo the cost in the screen.
- Please put all your code below, do not create a separate file. Do the runtime execution below as well. You can wrap it in HTML doc structure for bonus points.
- Bonus: if you have time, create a class called Ford which implements Car and have the cost calculated. However this time, Ford has a handling fee attached to it of $1,000 to be calculated before tax.